結果

問題 No.1869 Doubling?
ユーザー Omura Shunsuke
提出日時 2022-05-14 22:26:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 53,568 KB
最終ジャッジ日時 2024-07-23 09:22:51
合計ジャッジ時間 3,204 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
n = N+0
ans = 0
while M > 1 and N>0:
    N -= 1
    ans += M
    M = (M+1)//2
ans += N
if N > 70:
    print(ans)
else:
    print(min(ans,2**n-1))
0