Submission #19292

#TimeUsernameProblemLanguageResultExecution timeMemory
19292xdojuΑ (kriii4_P1)C++14
0 / 100
0 ms1084 KiB
#include <cstdio> using namespace std; const int MOD = 1000000007; void proc() { long long r, n; scanf("%lld", &r); scanf("%lld", &n); long long ret = 1; while (n > 0) { if (n % 2 > 0) { ret = (ret * r) % MOD; } r = (r * r) % MOD; n /= 2; } printf("%lld", ret); } int main() { proc(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...