Skip to content

Commit

Permalink
Merge branch 'main' into 17-bomik0221
Browse files Browse the repository at this point in the history
  • Loading branch information
bomik0221 authored Mar 1, 2024
2 parents 7010941 + 0ceee9a commit d318a45
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bomik0221/DP/240224.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <iostream>
#include <vector>

int main() {
int N; std::cin >> N;
std::vector<int> game(N+1, 0);
game[1] = 1; game[3] = 1; //์ƒ๊ทผ์ด๋Š” 1, ์ฐฝ์˜์ด๋Š” 2

for (int i = 2; i <= N; i++) {
if (game[i - 1] == 1) {
game[i] = 2;
if(i+2 <=N) game[i + 2] = 2;
}
else {
game[i] = 1;
if (i + 2 <= N) game[i + 2] = 1;
}
}

if (game[N] == 1) std::cout << "SK";
else std::cout << "CY";

return 0;
}

0 comments on commit d318a45

Please sign in to comment.