# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19647 | joinsung | Α (kriii4_P1) | C++98 | 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;
#define MOD 1000000007
long long pow[100];
int main() {
long long a, x;
cin >> a >> x;
long long s = 1;
for (int i = 0; i <= 64; i++) {
pow[i] = s;
s = s * s % MOD;
}
long long res = 1;
int bit = 0;
while (a > 0) {
if (a & 1 == 1)
res = (res * pow[bit]) % MOD;
bit++;
a >>= 1;
}
cout << res << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |