Submission #19529

#TimeUsernameProblemLanguageResultExecution timeMemory
19529metadataΑ (kriii4_P1)C++14
0 / 100
0 ms1084 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;i<64 && (1<<i)<=X;i++){ mod_bp[i]=(mod_bp[i-1]*mod_bp[i-1])%MOD; } for(i=0,r=1;i<64 && (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...