-
[Softeer] 바이러스 (lv.2)ALGORITHM/SWEXPERT|SOFTEER 2021. 11. 2. 22:42
https://softeer.ai/practice/info.do?eventIdx=1&psProblemId=407
2021
123456789101112131415161718192021import java.util.*;import java.io.*;public class Main{public static int N, K, P;public static void main(String args[]) throws IOException{BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));StringTokenizer st = new StringTokenizer(bf.readLine());K = Integer.parseInt(st.nextToken());P = Integer.parseInt(st.nextToken());N = Integer.parseInt(st.nextToken());long answer = K;for(int i = 1; i <= N; i++) {answer = (answer * P) % 1000000007;}System.out.println(answer);}}cs 'ALGORITHM > SWEXPERT|SOFTEER' 카테고리의 다른 글
[Softeer] 장애물 인식 프로그램 (lv.2) (0) 2021.11.02 [Softeer] 8단 변속기 (lv.2) (0) 2021.11.02 [Softeer] 성적 평균 (lv.3) (0) 2021.11.02 [시뮬레이션] 5658 :: 보물상자 비밀번호 (0) 2018.10.03 [BFS] 1953::탈주범 검거 (0) 2018.10.02