We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e17838 commit 05ebf7aCopy full SHA for 05ebf7a
서정우/10주차/260304.js
@@ -0,0 +1,25 @@
1
+const fs = require("fs");
2
+const filePath =
3
+ process.platform === "linux" ? "/dev/stdin" : "./서정우/input.txt";
4
+const input = fs
5
+ .readFileSync(filePath)
6
+ .toString()
7
+ .trim()
8
+ .split("\n")
9
+ .map((el) => el.trim());
10
+
11
+const [N, M] = input[0].split(" ").map(Number);
12
13
+const dp = new Array(N + 1).fill(false);
14
+dp[1] = true;
15
+dp[3] = true;
16
17
+for (let i = 2; i <= N; i++) {
18
+ if (i - 1 >= 0 && !dp[i - 1]) {
19
+ dp[i] = true;
20
+ } else if (i - 3 >= 0 && !dp[i - 3]) {
21
22
+ }
23
+}
24
25
+console.log(dp[N] ? "SK" : "CY");
서정우/input.txt
@@ -1,2 +1 @@
-8 10
-2 2 2 2 11 2 5 2
+5
0 commit comments