Pagini recente » Cod sursa (job #1809735) | Cod sursa (job #36484) | Cod sursa (job #1777665) | Cod sursa (job #3280925) | Cod sursa (job #2930701)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
const uint64_t MOD = 1999999973;
int main() {
FILE* fin = fopen("lgput.in", "r");
FILE* fout = fopen("lgput.out", "w");
uint64_t n, p;
fscanf(fin, "%llu %llu", &n, &p);
n %= MOD;
uint64_t pow = 1;
while(p) {
if(p & 1) {
pow *= n;
}
n *= n;
n %= MOD;
p >>= 1;
}
fprintf(fout, "%llu", pow);
fclose(fin);
fclose(fout);
}