Submission #19329

#TimeUsernameProblemLanguageResultExecution timeMemory
19329isac322Α (kriii4_P1)C++14
100 / 100
0 ms1084 KiB
#include <cstdio> #include <algorithm> using namespace std; const long long MOD = 1000000007; long long a, x; long long solve(long long n) { if (n == 1) return a; long long ret = solve(n >> 1); return (((ret*ret) % MOD) * (n & 1LL ? a : 1LL)) % MOD; } int main() { scanf("%lld%lld", &a, &x); a %= MOD; printf("%lld", solve(x)); }
#Verdict Execution timeMemoryGrader output
Fetching results...