Submission #19546

#TimeUsernameProblemLanguageResultExecution timeMemory
19546joojisΑ (kriii4_P1)C++14
100 / 100
0 ms1084 KiB
#include <cstdio> const long long unsigned MOD = 1000000007; int main () { long long unsigned a, x; scanf("%llu %llu", &a, &x); long long unsigned answer=1; a %= MOD; while (x>0) { answer *= x%2 ? a : 1; answer %= MOD; x/=2; a = (a*a) % MOD; } printf("%llu\n", answer); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...