Submission #19647

#TimeUsernameProblemLanguageResultExecution timeMemory
19647joinsungΑ (kriii4_P1)C++98
0 / 100
0 ms1716 KiB
#include <iostream> using namespace std; #define MOD 1000000007 long long pow[100]; int main() { long long a, x; cin >> a >> x; long long s = 1; for (int i = 0; i <= 64; i++) { pow[i] = s; s = s * s % MOD; } long long res = 1; int bit = 0; while (a > 0) { if (a & 1 == 1) res = (res * pow[bit]) % MOD; bit++; a >>= 1; } cout << res << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...