# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19597 | nona1314 | Α (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>
using namespace std;
const long long MMOD = 1000000007;
int main() {
long long A, X;
scanf("%lld%lld", &A, &X);
long long ans = 1;
while (X > 0) {
if (X & 1 > 0) ans = (ans*A) % MMOD;
X = X >> 1;
A = (A*A) % MMOD;
}
printf("%lld\n", ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |