제출 #19342

#제출 시각아이디문제언어결과실행 시간메모리
19342algoshipdaΑ (kriii4_P1)C++14
100 / 100
0 ms1716 KiB
#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 timeMemoryGrader output
Fetching results...