Pagini recente » Cod sursa (job #2060104) | Monitorul de evaluare | Cod sursa (job #2599155) | Borderou de evaluare (job #1294011) | Cod sursa (job #327442)
Cod sursa(job #327442)
#include<cstdio>
long long n,p,div=1999999973;
int putere(long long x)
{ if(x==0) return 1;
else if(x%2==1) return (n*putere(x-1))%div;
else { long long q=putere(x/2);
return (q*q)%div;
}
}
int main()
{ freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld%lld",&n,&p);
printf("%lld",putere(p));
return 0;}