結果

問題 No.820 Power of Two
ユーザー eiji1000
提出日時 2019-07-10 14:15:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-15 04:42:13
合計ジャッジ時間 944 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

def power_of_two(n,k):
    x_min = 2**k
    x_max = 2**n
    counter = 0
    
    x = x_min 
    if x == 1:
        counter = x_max
    
    else:
        while x <= x_max:
            counter += 1
            x += x_min
        
    return counter

n,k = map(int,input().split())

ans = power_of_two(n,k)

print(ans)
0