Algorithm

분산처리 (백준 알고리즘 1009번)

OOOooOOoo·2019년 5월 23일·조회 3,480

1. 문제

https://www.acmicpc.net/problem/10091

맞는지 모르겠지만 한번 풀어봤네요.


2 코드

	public static void main(String[] args) {
		int pcCount = 10;
		
		int[] i1 = { 1, 3, 6, 7, 9 };
		int[] i2 = { 6, 7, 2, 100, 635 };

		for ( int y=0; y<i1.length; y++ ) {
			int result = 0;
			
			result = i1[y];
			
			for ( int z=1; z<i2[y]; z++) {
				result *= i1[y];
				result %= pcCount;
			}
			
			if ( result == 0 ) result = 10;
			
			System.out.println(i1[y] + " " + i2[y] + " -> " + result);
		}
	}

댓글 0

로그인 후 댓글을 남길 수 있습니다.

아직 댓글이 없습니다.