Home H116908. 바이러스
Post
Cancel

H116908. 바이러스

문제

image


제출 코드

image


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);
    }
}
This post is licensed under CC BY 4.0 by the author.