Submission #19344

#TimeUsernameProblemLanguageResultExecution timeMemory
19344ilbbkeΑ (kriii4_P1)C++98
100 / 100
0 ms1720 KiB
#include<bits/stdc++.h> #define ll long long #define M 1000000007 using namespace std; ll a,b,ans=1; void f(ll c,ll x){ if(x>b) return; f((c*c)%M,x*2); if(x<=b){ ans=(ans*c)%M; b-=x; } } int main() { scanf("%lld%lld",&a,&b); f(a%M,1); printf("%lld\n",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...