Pagini recente » Cod sursa (job #1661361) | Cod sursa (job #2151238) | Cod sursa (job #2133503) | Cod sursa (job #2095985) | Cod sursa (job #627489)
Cod sursa(job #627489)
#include<cstdio>
int n, p;
long long PutereLog(int n, int p)
{
long long x = n;
p--;
while(p > 0)
{
if(p & 1)
{
x = x * n;
p--;
}
else
{
x = x * x;
p /= 2;
}
x %= 1999999973;
}
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));
return 0;
}