Submission #19468

#TimeUsernameProblemLanguageResultExecution timeMemory
19468joonasΑ (kriii4_P1)C++98
100 / 100
0 ms1720 KiB
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long lld; lld gpow(lld a, lld x){ if(x == 0) return 1; if(x < 1) return a%MOD; lld r = gpow(a, x/2)%MOD; if(x&1) return ((r*r)%MOD * (a%MOD))%MOD; return (r*r)%MOD; } int main(){ lld n, k; scanf("%lld %lld", &n, &k); printf("%lld", gpow(n, k)%MOD); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...