슈콩

[SWEA] 프리셀 통계 본문

Algorithms/이론

[SWEA] 프리셀 통계

shukong 2025. 11. 16. 15:30

 

 

[문제]

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXmwMidaSLIDFARX

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

 

[소스 코드]

import java.io.*;
import java.util.*;
public class Solution {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		int T = Integer.parseInt(br.readLine());
		for(int tc=1;tc<=T;tc++) {
			st = new StringTokenizer(br.readLine());
			long n = Long.parseLong(st.nextToken());
			int pd = Integer.parseInt(st.nextToken());
			int pg = Integer.parseInt(st.nextToken());
			String result = "Broken";
			if(!((pd!=100 && pg==100)||(pd!=0 && pg==0))) {
				while(n>0) {
					if(n*pd%100==0) {
						result = "Possible";
						break;
					}
					n--;
				}
			}
			System.out.println("#"+tc+" "+result);
		}
	}
}

'Algorithms > 이론' 카테고리의 다른 글

0x0E 정렬 1  (0) 2025.08.19