Submission #19297

#TimeUsernameProblemLanguageResultExecution timeMemory
19297hongjun7Α (kriii4_P1)C++14
100 / 100
0 ms1084 KiB
#include <stdio.h> int mod = 1e9 + 7; long long f(long long a, long long b) { if (b == 0) return 1; if (b == 1) return a; long long v = f(a, b / 2); v = (v*v) % mod; if (b & 1) v = (v*a) % mod; return v; } int main() { long long a, b; scanf("%lld%lld", &a, &b); a %= mod; printf("%lld", f(a, b)); }
#Verdict Execution timeMemoryGrader output
Fetching results...