Pagini recente » Cod sursa (job #384754) | Cod sursa (job #1389894) | Cod sursa (job #1545765) | Cod sursa (job #788249) | Cod sursa (job #1794037)
#include <iostream>
#include <cstdio>
using namespace std;
FILE *f, *g;
long long a, b;
long long putere(long long a, long long b)
{
long long p = 1, i, c = a;
for(i = 0; (1 << i) <= b; i ++)
{
if(((1 << i) & b) > 0)
{
p = (p * c) % 1999999973;
}
c *= c;
c %= 1999999973;
}
return p;
}
void readFile()
{
f = fopen("lgput.in", "r");
fscanf(f, "%lld%lld", &a, &b);
fclose(f);
}
void solveAndPrint()
{
g = fopen("lgput.out", "w");
fprintf(g, "%lld\n", putere(a, b));
fclose(g);
}
int main()
{
readFile();
solveAndPrint();
return 0;
}