Pagini recente » Cod sursa (job #3177552) | Cod sursa (job #2109756) | Cod sursa (job #1709326) | Cod sursa (job #670130) | Cod sursa (job #156490)
Cod sursa(job #156490)
#include <stdio.h>
#define modulo 1999999973
int n, p;
int pow(int x, int y)
{
int aux;
if (y == 0)
return 1;
if (y & 1)
return ((x * pow(x, y-1)) % modulo);
else
aux = (pow(x, y/2) % modulo);
return ((aux*aux) % modulo);
}
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out","w",stdout);
scanf("%d %d ", &n, &p);
printf("%d\n", pow(n, p));
return 0;
}