• 문제 링크
https://www.acmicpc.net/problem/24789
• 풀이 코드
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));
read();
bw.write(read() % 2 == 0 ? "possible" : "impossible");
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' 카테고리의 다른 글
[백준] 24077 比較 (Comparison) - Brute Force / Java (0) | 2025.03.03 |
---|---|
[백준] 32942 그래프와 그래프 - Graph Theory / Java (0) | 2025.03.02 |
[백준] 17204 죽음의 게임 - Graph Theory / Java (0) | 2025.02.28 |
[백준] 4531 Verdis Quo - Data Structure / Java (0) | 2025.02.27 |
[백준] 4359 Forests - Data Structure / Java (0) | 2025.02.26 |
댓글