카테고리 없음
[Algorithm] 백준 #2164 카드2
walbe0528
2024. 7. 8. 00:54
728x90
반응형
import sys
from collections import deque
input = sys.stdin.readline
N = int(input())
q = deque([i for i in range(1, N+1)])
while len(q) != 1:
q.popleft()
q.append(q.popleft())
print(q[0])
728x90