본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 21756번 지우개

by 현장 2022. 5. 5.

-Code

n = int(input())
nums = [i for i in range(1, n + 1)]
while len(nums) > 1:
    temp = []
    for i in range(len(nums)):
        if i % 2:
            temp.append(nums[i])
    nums = temp

print(*nums)