Skip to content

Commit 4151765

Browse files
committed
Solved: 2164 카드2
1 parent e18e593 commit 4151765

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

INSEA-99/week05/2164_카드2.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# pypy3
2+
# 시간(ms) : 132
3+
# 공간(KB) : 121240
4+
5+
import sys
6+
from collections import deque
7+
input = sys.stdin.readline
8+
9+
n = int(input().strip())
10+
q = deque(list(range(1, n+1))) # 1~n 리스트 생성
11+
while len(q) != 1 : # 1개 남을 때까지 수행
12+
q.popleft()
13+
q.append(q.popleft())
14+
print(q[0])

0 commit comments

Comments
 (0)