# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19322 | isac322 | Α (kriii4_P1) | C++14 | 0 ms | 1084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |