• 문제 링크
https://www.acmicpc.net/problem/10214
• 풀이 코드
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class Main {
public static void main(String[] args) throws IOException {
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();
int t = read();
while (t-- > 0) {
int y = 0, k = 0;
for (int i = 0; i < 9; i++) {
y += read();
k += read();
}
sb.append(y > k ? "Yonsei" : y < k ? "Korea" : "Draw").append("\n");
}
bw.write(sb.toString());
bw.flush();
}
private static int read() throws IOException {
int c, n = System.in.read() & 15;
while ((c = System.in.read()) > 32) n = (n << 3) + (n << 1) + (c & 15);
return n;
}
}
'Problem Solving > Baekjoon' 카테고리의 다른 글
[백준] 11580 Footprint - Data Structure / Java (0) | 2024.12.30 |
---|---|
[백준] 10179 쿠폰 - Implementation / Java (0) | 2024.12.29 |
[백준] 10822 더하기 - Implementation / Java (0) | 2024.12.27 |
[백준] 10812 바구니 순서 바꾸기 - Implementation / Java (0) | 2024.12.26 |
[백준] 1568 새 - Implementation / Java (0) | 2024.12.25 |
댓글