[큐 - 2164번] 카드2

Jeong Ha Seung·2022년 1월 31일

n = int(input())
q = deque([i for i in range(1, n+1)])

while(len(q) > 1):
    q.popleft()
    move_num = q.popleft()
    q.append(move_num)

print(q[0])

0개의 댓글