BOJ - 19945 - 새로운 언어 CC

Updated:

def solution():
    N = int(input())
    bit = 1
     
    if N < 0: print(32)
    elif 0 <= N < 2: print(1)
    else:
        count = 0
        while bit <= N:
            count += 1
            bit *= 2

        print(count)

solution()

https://www.acmicpc.net/problem/19945

Categories:

Updated:

Leave a comment