# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19318 | xhae | Α (kriii4_P1) | C++14 | 0 ms | 1716 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 <iostream>
using namespace std;
int main(void) {
const unsigned long long MOD = 1000000007;
unsigned long long a, x;
cin >> a >> x;
a %= MOD;
unsigned long long ans = 1;
for(int i = 62; i >= 0; i--) {
ans = ans * ans % MOD;
if((1ull << i) & x) ans = ans * a % MOD;
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |