Skip to content

Commit

Permalink
[Silver V] Title: 돌 게임, Time: 36 ms, Memory: 31120 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
goohong committed Sep 4, 2024
1 parent 0fdfd92 commit 1d32373
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
32 changes: 32 additions & 0 deletions 백준/Silver/9655. 돌 게임/README.md
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>

6 changes: 6 additions & 0 deletions 백준/Silver/9655. 돌 게임/돌 게임.py
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")

0 comments on commit 1d32373

Please sign in to comment.