Submission #19604

#TimeUsernameProblemLanguageResultExecution timeMemory
19604jeapiΑ (kriii4_P1)C++98
100 / 100
0 ms1716 KiB
#include<iostream> using namespace std; typedef long long ll; ll Pow(ll a, ll b) { if (b == 1) { return a; } ll temp = Pow(a, b / 2); ll Temp = temp*temp % 1000000007; if (b % 2 == 0) { return Temp; } return (Temp*a) % 1000000007; } int main() { ll a, b; cin >> a >> b; a = a % 1000000007; cout << Pow(a, b) << ' '; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...