Submission #19631

#TimeUsernameProblemLanguageResultExecution timeMemory
19631yongwhanΑ (kriii4_P1)C++98
100 / 100
0 ms1716 KiB
#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 timeMemoryGrader output
Fetching results...