Submission #19056

#TimeUsernameProblemLanguageResultExecution timeMemory
19056kriiiΑ (kriii4_P1)C++14
100 / 100
0 ms1084 KiB
#include <stdio.h> const long long mod = 1000000007; long long fpow(long long a, long long p) { a = (a % mod + mod) % mod; p = (p % (mod - 1) + mod - 1) % (mod - 1); long long r = 1; while (p){ if (p & 1) r = r * a % mod; a = a * a % mod; p >>= 1; } return r; } int main() { long long a,x; scanf ("%lld %lld",&a,&x); printf ("%lld\n",fpow(a,x)); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...