Submission #19525

#TimeUsernameProblemLanguageResultExecution timeMemory
19525NamnamseoΑ (kriii4_P1)C++14
100 / 100
0 ms1716 KiB
#include <iostream> using namespace std; typedef long long ll; ll a,b; int M=int(1e9)+7; ll pow(ll a,ll b){ if(b==0) return 1; ll ret=pow(a,b/2); ret=(ret*ret)%M; if(b&1) ret=(ret*a)%M; return ret; } int main() { cin>>a>>b; a%=M; b%=(M-1); cout<<pow(a,b); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...