-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Silver V] Title: 돌 게임, Time: 36 ms, Memory: 31120 KB -BaekjoonHub
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# [Silver V] 돌 게임 - 9655 | ||
|
||
[문제 링크](https://www.acmicpc.net/problem/9655) | ||
|
||
### 성능 요약 | ||
|
||
메모리: 31120 KB, 시간: 36 ms | ||
|
||
### 분류 | ||
|
||
다이나믹 프로그래밍, 게임 이론, 수학 | ||
|
||
### 제출 일자 | ||
|
||
2024년 9월 5일 00:11:10 | ||
|
||
### 문제 설명 | ||
|
||
<p>돌 게임은 두 명이서 즐기는 재밌는 게임이다.</p> | ||
|
||
<p>탁자 위에 돌 N개가 있다. 상근이와 창영이는 턴을 번갈아가면서 돌을 가져가며, 돌은 1개 또는 3개 가져갈 수 있다. 마지막 돌을 가져가는 사람이 게임을 이기게 된다.</p> | ||
|
||
<p>두 사람이 완벽하게 게임을 했을 때, 이기는 사람을 구하는 프로그램을 작성하시오. 게임은 상근이가 먼저 시작한다.</p> | ||
|
||
### 입력 | ||
|
||
<p>첫째 줄에 N이 주어진다. (1 ≤ N ≤ 1000)</p> | ||
|
||
### 출력 | ||
|
||
<p>상근이가 게임을 이기면 SK를, 창영이가 게임을 이기면 CY을 출력한다.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
n = int(input()) | ||
|
||
if n % 2 == 0: | ||
print("CY") | ||
else: | ||
print("SK") |