Pagini recente » Cod sursa (job #1836300) | Cod sursa (job #456950) | Monitorul de evaluare | Cod sursa (job #822863) | Cod sursa (job #2116704)
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
int main(void)
{
FILE *in = fopen("lgput.in", "r");
FILE *out = fopen("lgput.out", "w");
if(in != NULL && out != NULL)
{
uint64_t x, n;
fscanf(in, "%llu%*c%llu%*c", &x, &n);
uint64_t m = 1999999973, res = 1;
while(n)
{
if(n % 2 != 0)
{
res = ((res % m) * (x % m)) % m;
}
x = ((x % m) * (x % m)) % m;
n /= 2;
}
fprintf(out, "%llu\n", res);
fclose(in);
fclose(out);
}
else
{
printf("file error\n");
}
return 0;
}