# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19343 | min050820 | Α (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 a,x;
const long long mod=1000000007;
long long pow(long long N,long long P){
if(P<2) return N%mod;
long long tmp=pow(N,P/2);
if(P&1){
return (((N * tmp)%mod) * tmp)%mod;// P%2==1
}
else{
return (tmp * tmp)%mod;// P%2==0
}
}
int main()
{
cin >> a >> x;
a%=mod;
x%=mod;
cout << pow(a,x);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |