Pagini recente » Cod sursa (job #3196648) | Cod sursa (job #2634647) | Borderou de evaluare (job #999931) | Cod sursa (job #2984130) | Cod sursa (job #2887333)
#include <iostream>
#include <cstdio>
using namespace std;
const unsigned long long MOD = 1999999973;
unsigned long long fast_pow(unsigned long long a, unsigned long long p) {
unsigned long long rezultat = 1;
a %= MOD;
p %= MOD;
while(p) {
if(p & 1)
rezultat = (rezultat * a) % MOD;
a = (a * a) % MOD;
p >>= 1;
}
return rezultat;
}
int main() {
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
unsigned long long n, p;
scanf("%llu %llu", &n, &p);
printf("%llu", fast_pow(n, p));
return 0;
}