Pagini recente » Profil florinhaja | Cod sursa (job #1290864) | Cod sursa (job #152047) | Cod sursa (job #128914) | Cod sursa (job #1603089)
#include <stdio.h>
#include <stdlib.h>
#define N 1999999973
long long n,p;
long long temp;
long long lgput(long long pt){
if(pt==1){
return n;
}
temp=lgput(pt/2)%N;
if(pt%2==1){
return temp*temp*n;
}else{
return temp*temp;
}
}
int main(){
freopen("lgput.in","r",stdin);
freopen("lgput.out","w",stdout);
scanf("%lld%lld",&n,&p);
printf("%lld",lgput(p)%N);
return 0;
}