[백준] 막대기

 

문제

x = int(input())

sticks = [64]

while sum(sticks) > x:
    shortest = min(sticks)
    half = shortest // 2
    sticks.remove(shortest)
    sticks.append(half)
    sticks.append(half)
    if sum(sticks[:-1]) >= x:
        sticks.pop()
print(len(sticks))