# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19631 | yongwhan | Α (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<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
typedef long long ll;
ll exp(ll a, ll b, ll m) {
ll r=1;
while(b) {
if(b%2) r=(r*a)%m;
a=(a*a)%m;
b/=2;
}
return r;
}
int main() {
ll a,x; cin>>a>>x;
a%=mod;
cout << exp(a,x,mod) << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |