Pagini recente » Cod sursa (job #433986) | Cod sursa (job #626167) | Cod sursa (job #608152) | Cod sursa (job #2311886) | Cod sursa (job #2043720)
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
FILE* in = fopen("lgput.in", "r"); ///probleme
FILE* out = fopen("lgput.out", "w");
long long a, b, p = 1;
fscanf(in, "%lld%lld", &a, &b);
while(b > 0)
{
if(b % 2 == 1)
{
p *= a;
p %= 1999999973;
a = a * a;
a %= 1999999973;
b--;
b /= 2;
}
else
{
a = a * a;
a %= 1999999973;
b /= 2;
}
}
int r = p % 1999999973;
fprintf(out, "%d", r);
}