# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19342 | algoshipda | Α (kriii4_P1) | C++14 | 0 ms | 1716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
const int MOD = 1e9 + 7;
struct Bignum;
lld fpow(lld n, lld k)
{
if(k == 0) return 1;
if(k % 2){
return n * fpow(n, k - 1) % MOD;
}
lld half = fpow(n, k/2);
return half * half % MOD;
}
int main()
{
lld n, k;
cin >> n >> k;
cout << fpow(n % MOD, k);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |