제출 코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.*;
import java.io.*;
public class Main
{
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = br.readLine().split(" ");
long result = Integer.parseInt(str[0]);
int P = Integer.parseInt(str[1]);
int N = Integer.parseInt(str[2]);
for(int n=0; n<N; n++) result = (result * P) %1000000007;
System.out.println(result);
}
}