Submission #19563

#TimeUsernameProblemLanguageResultExecution timeMemory
19563suzyΑ (kriii4_P1)C++98
100 / 100
0 ms1084 KiB
#include <stdio.h> #define MOD 1000000007 typedef long long lli; lli f(lli a, lli x) { if(x==0) return 1; if(x%2) return a*f(a,x-1)%MOD; else { lli m=f(a,x/2); return m*m%MOD; } } int main() { lli a, x; scanf("%lld %lld",&a,&x); a%=MOD; printf("%lld",f(a,x)); }
#Verdict Execution timeMemoryGrader output
Fetching results...