Submission #19341

# Submission time Handle Problem Language Result Execution time Memory
19341 2016-02-24T10:12:58 Z algoshipda Α (kriii4_P1) C++14
0 / 100
0 ms 1716 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long lld;
const int MOD = 1e9 + 7;

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, k);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1716 KB Output isn't correct
2 Halted 0 ms 0 KB -