# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
32307 | TAMREF | Α (kriii4_P1) | C++11 | 0 ms | 2016 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;
typedef long long ll;
const ll mod = 1e9+7;
ll npow(ll a, ll n){
ll res = 1, pval = a%mod;
for(;n;n>>=1,pval=pval*pval%mod){
if(n&1) res = res*pval%mod;
}
return res;
}
int main(){
ll a,n;
cin>>a>>n;
cout<<npow(a,n)<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |