-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboj9657.java
More file actions
39 lines (30 loc) · 829 Bytes
/
boj9657.java
File metadata and controls
39 lines (30 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class boj9657 {
static int N;
static int[] dp;
public static void main(String[] args) throws IOException {
input();
pro();
}
static void input() throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(br.readLine());
dp = new int[1001];
dp[1] = 1;
dp[2] = 0;
dp[3] = 1;
dp[4] = 1;
}
static void pro() {
for (int i = 5; i <= N; i++) {
if (dp[i - 1] + dp[i - 3] + dp[i - 4] < 3) {
dp[i] = 1;
} else {
dp[i] = 0;
}
}
System.out.println(dp[N] == 1 ? "SK" : "CY");
}
}