Pagini recente » Cod sursa (job #1085991) | Cod sursa (job #7351) | Cod sursa (job #2728033) | Rating toderita catalina (blueyes) | Cod sursa (job #283625)
Cod sursa(job #283625)
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define FIN "lgput.in"
#define FOUT "lgput.out"
typedef long long LL;
const LL MOD = 1999999973;
LL N, P;
void read() {
scanf("%lld %lld", &N, &P);
}
LL pow(int N, int P) {
if (P == 0)
return 1;
if (P == 1)
return N % MOD;
if (P % 2)
return (N * pow(N, P - 1)) % MOD;
else {
LL tmp = pow(N, P / 2);
return (tmp * tmp) % MOD;
}
}
void solve() {
printf("%lld\n", pow(N, P));
}
int main() {
freopen(FIN, "r", stdin);
freopen(FOUT, "w", stdout);
read();
solve();
return 0;
}