Pagini recente » Cod sursa (job #1962610) | Cod sursa (job #509105) | Cod sursa (job #2789010) | Cod sursa (job #2770185) | Cod sursa (job #1236939)
#include <fstream>
using namespace std;
int logpow(int a,int b, const int& mod) {
int ret = 1;
while (b > 0) {
if (b & 1) {
ret = 1LL * a * a % mod;
}
a = 1LL * a * a % mod;
b >>= 1;
}
return ret;
}
int main() {
ifstream cin("lgput.in");
ofstream cout("lgput.out");
const int mod = 1999999973;
int N, P;
cin >> N >> P;
cout << logpow(N, P % (mod - 1), mod);
return 0;
}