on my way

[백준 2164번] 카드2 (Python3, 실버4) 본문

algorithm/Python

[백준 2164번] 카드2 (Python3, 실버4)

wingbeat 2025. 1. 21. 03:34
반응형

https://www.acmicpc.net/problem/2164

from collections import deque
import sys
queue = deque(range(1, int(sys.stdin.readline())+1))
while len(queue) > 1:
    queue.popleft()
    queue.rotate(-1)
print(queue[0])

 

반응형