# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19297 | hongjun7 | Α (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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |