Pagini recente » Cod sursa (job #3250585) | Cod sursa (job #2107802) | Cod sursa (job #2839887) | Cod sursa (job #1607152) | Cod sursa (job #627484)
Cod sursa(job #627484)
#include<cstdio>
int n, p;
long long PutereLog(int n, int p)
{
long long x = 1;
while(p > 0)
{
if(p & 1)
{
x = x * n;
p--;
}
else
{
x = x * x;
p /= 2;
}
}
return x;
}
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d %d", &n, &p);
printf("%lld\n", PutereLog(n, p) % 1999999973);
return 0;
}