Submission #19520

#TimeUsernameProblemLanguageResultExecution timeMemory
19520metadataΑ (kriii4_P1)C++14
0 / 100
0 ms1080 KiB
#include<cstdio> #define MOD 1000000007 long long mod_bp[65]; long long A,X,r; int main(){ scanf("%lld %lld",&A,&X); mod_bp[0]=A%MOD; int i; for(i=1;(1<<i)<=X;i++){ mod_bp[i]=(mod_bp[i-1]*mod_bp[i-1])%MOD; } for(i=0,r=1;(1<<i)<=X;i++){ if((1<<i)&X){ r*=mod_bp[i]; r%=MOD; } } printf("%lld",r); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...