Submission #19322

#TimeUsernameProblemLanguageResultExecution timeMemory
19322isac322Α (kriii4_P1)C++14
0 / 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); printf("%lld", solve(x)); }
#Verdict Execution timeMemoryGrader output
Fetching results...