Submission #19436

#TimeUsernameProblemLanguageResultExecution timeMemory
19436nosiarΑ (kriii4_P1)C++14
100 / 100
0 ms1716 KiB
#include <iostream> using namespace std; long long mod = 1000000007; long long a,x; long long m[65]; int main() { cin>>a>>x; m[1] = a % mod; for(int i = 2; i <= 64; ++i) m[i] = (m[i-1]*m[i-1])% mod; long long ans = 1; int i = 1; while(x) { if(x&1) ans = (ans*m[i])%mod; x >>= 1; ++i; } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...