본잡 이어가기/BaekJoon
[백준 / Java] 2476번
UMING
2022. 7. 10. 09:21
https://www.acmicpc.net/problem/2476
2476번: 주사위 게임
첫째 줄에는 참여하는 사람 수 N이 주어지고 그 다음 줄부터 N개의 줄에 사람들이 주사위를 던진 3개의 눈이 빈칸을 사이에 두고 각각 주어진다.
www.acmicpc.net

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int min=0;
for(int i=0; i<n; i++) {
int sum = 0;
int x = scan.nextInt();
int y = scan.nextInt();
int z = scan.nextInt();
if(x==y&&y==z&&z==x) {
sum=10000+(x*1000);
}
else if(x==y||x==z) {
sum= 1000+(x*100);
}
else if(y==z) {
sum= 1000+(y*100);
}
else {
int max= Math.max(x, Math.max(y, z));
sum=max*100;
}
if(min<sum)
min=sum;
}
System.out.println(min);
}
}