백준_해시 해킹(26008번)

tth-k·2023년 8월 10일

0base_tth

목록 보기
5/9

문제

입출력

예제들

코드작성

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long answer = 1L;

		int n = sc.nextInt();
		int m = sc.nextInt();
		int a = sc.nextInt();
		int h = sc.nextInt();

		for(int i = 0; i < n-1; i ++){
			answer = (answer * m)%1000000007;
		}
        System.out.println(answer);
	}
}

Etc

너무 어려운 것 같아 다른 블로그를 참고했다..
출처) https://nukoori.tistory.com/40

profile
백엔드 취준생 / 코린이 ヾ(≧▽≦*)o

0개의 댓글