반응형
from collections import deque
import sys
N = int(sys.stdin.readline())
q = deque([])
for i in range(1,N+1):
q.append(i)
while len(q) != 1:
q.popleft()
x = q[0]
q.popleft()
q.append(x)
print(q[0])
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 13241 (0) | 2020.09.14 |
---|---|
baekjoon - python - 11866 (0) | 2020.09.14 |
baekjoon - python - 11942 (0) | 2020.09.13 |
baekjoon - python - 11729 (0) | 2020.09.13 |
baekjoon - python - 11721 (0) | 2020.09.13 |
댓글