# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19436 | nosiar | Α (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;
long long mod = 1000000007;
long long a,x;
long long m[65];
int main() {
cin>>a>>x;
m[1] = a % mod;
for(int i = 2; i <= 64; ++i)
m[i] = (m[i-1]*m[i-1])% mod;
long long ans = 1;
int i = 1;
while(x)
{
if(x&1) ans = (ans*m[i])%mod;
x >>= 1;
++i;
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |