Pagini recente » Cod sursa (job #376599) | Cod sursa (job #2127947) | Cod sursa (job #2305219) | Cod sursa (job #273596) | 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;
}