Pagini recente » Cod sursa (job #100661) | Cod sursa (job #2467111) | Cod sursa (job #1744465) | Cod sursa (job #2060486) | Cod sursa (job #1794034)
#include <iostream>
#include <cstdio>
using namespace std;
FILE *f, *g;
int a, b;
int putere(int a, int b)
{
int 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, "%d%d", &a, &b);
fclose(f);
}
void solveAndPrint()
{
g = fopen("lgput.out", "w");
fprintf(g, "%d\n", putere(a, b));
fclose(g);
}
int main()
{
readFile();
solveAndPrint();
return 0;
}