Pagini recente » Borderou de evaluare (job #2040891) | Cod sursa (job #793100) | Cod sursa (job #1671596) | Cod sursa (job #2390104) | Cod sursa (job #2871210)
#include <stdio.h>
#include <string.h>
int fast_pow(int base, int exponent, int mod) {
if (exponent == 0) {
return 1;
}
int result = fast_pow(base, exponent / 2, mod);
if (exponent % 2 == 0) {
return (1LL * result * result) % mod;
}
return (1LL * base * fast_pow(base, exponent - 1, mod)) % mod;
}
int main() {
unsigned int n, p;
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%d %d", &n, &p);
int mod = 1999999973;
printf("%d\n", fast_pow(n, p, mod));
}