Pagini recente » Cod sursa (job #2715063) | Cod sursa (job #889480) | Cod sursa (job #22918) | Rating Stefan Albu (prodseven) | Cod sursa (job #2499415)
#include <cstdio>
const int MOD = 1999999973;
int N, K;
int lgput(int base, int exponent) {
int result = 1, basePow2Value = base;
for (int powIdx = 0; (1 << powIdx) <= exponent; powIdx++) {
if (exponent & (1 << powIdx)) {
result = (1LL * result * basePow2Value) % MOD;
}
basePow2Value = (1LL * basePow2Value * basePow2Value) % MOD;
}
return result;
}
int main() {
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d%d", &N, &K);
printf("%d\n", lgput(N, K));
return 0;
}