[알고리즘] 큐, 덱 - 백준 2164번 카드2

minidoo·2020년 12월 11일
0

알고리즘

목록 보기
79/85
post-thumbnail

정답 코드

import sys
from collections import deque
input = sys.stdin.readline

N = int(input())
arr = deque()
for i in range(1, N+1):
    arr.append(i)

while len(arr) > 1:
    arr.popleft()
    arr.append(arr.popleft())

print(arr[0])

0개의 댓글