Pagini recente » Cod sursa (job #406481) | Cod sursa (job #1186994) | Cod sursa (job #572538) | Cod sursa (job #1663947) | Cod sursa (job #1284676)
#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("%ld%ld", &n, &p);
printf("%ld",PutereLogaritmic(n,p)% 1999999973);
return 0;
}