Pagini recente » Cod sursa (job #1709971) | Cod sursa (job #3223468) | Cod sursa (job #2321595) | Cod sursa (job #3241392) | Cod sursa (job #146385)
Cod sursa(job #146385)
#include <stdio.h>
long long a,b,c,i,j,k;
long long t;
long long rec(int b)
{
if (b==1) return a;
if (b%2==0)
{
k=rec(b/2);
t=((k%c)*(k%c))%c;
return t;
}
else
{
k=rec(b/2);
t=((((k%c)*(k%c))%c) *(a%c))%c;
return t;
}
}
int main()
{
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld %lld",&a,&b);
c=1999999973;
printf("%lld",rec(b));
return 0;
}