from collections import deque
d=deque()
for i in range(1,int(input())+1):
d.append(i)
while len(d)!=1:
d.popleft()
k=d.popleft()
d.append(k)
print(d.pop())
'알고리즘 > 백준' 카테고리의 다른 글
백준-2231번(분해합)-python3 (0) | 2023.11.24 |
---|---|
백준-2178번(미로 탐색)-python3 (0) | 2023.11.24 |
백준-2163번(초콜릿 자르기)-python3 (0) | 2023.11.24 |
백준-2108번(통계학)-python3 (0) | 2023.11.24 |
백준-1978번(소수 찾기)-python3 (0) | 2023.11.24 |