[백준][Python] 2164 카드2 deque로 구현했습니다. import sys input = sys.stdin.readline from collections import deque N = int(input()) q = deque([i for i in range(1, N + 1)]) while len(q) != 1: q.popleft() if len(q) == 1: break q.rotate(-1) print(q.pop()) practivceAlgorithm/백준 2021.10.19