Submission #19318

#TimeUsernameProblemLanguageResultExecution timeMemory
19318xhaeΑ (kriii4_P1)C++14
100 / 100
0 ms1716 KiB
#include <iostream> using namespace std; int main(void) { const unsigned long long MOD = 1000000007; unsigned long long a, x; cin >> a >> x; a %= MOD; unsigned long long ans = 1; for(int i = 62; i >= 0; i--) { ans = ans * ans % MOD; if((1ull << i) & x) ans = ans * a % MOD; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...