Pagini recente » Cod sursa (job #605223) | Cod sursa (job #903094) | Cod sursa (job #2592739) | Cod sursa (job #71036) | Cod sursa (job #2032150)
#include<cstdio>
#include<algorithm>
using namespace std;
bool cresc;
int main()
{
FILE* in = fopen("lgput.in", "r"); ///probleme
FILE* out = fopen("lgput.out", "w");
int a, b, p = 1;
fscanf(in, "%d%d", &a, &b);
while(b > 0)
{
if(b % 2 == 1)
{
p *= a;
a = a * a;
b--;
b /= 2;
}
else
{
a = a * a;
b /= 2;
}
}
int r = p % 1999999973;
fprintf(out, "%d", r);
}