Pagini recente » Cod sursa (job #2115964) | Cod sursa (job #2060568) | Cod sursa (job #33979) | Cod sursa (job #1954386) | Cod sursa (job #1284673)
#include <stdio.h>
long unsigned int PutereLogaritmic(long unsigned int x, long unsigned int n)
{
long unsigned int p = 1 ;
while (n > 0)
{
if (n%2==1)
{
p *= x;
n-- ;
}
x = x * x ;
n = n / 2;
}
return p ;
}
long unsigned int n,p;
int main()
{
freopen("lgput.in", "r", stdin);
freopen("lgput.out", "w", stdout);
scanf("%d%d", &n, &p);
printf("%ld",PutereLogaritmic(n,p)% 1999999973);
return 0;
}