結果

問題 No.1869 Doubling?
ユーザー ikomaikoma
提出日時 2022-03-11 22:32:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 148 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-09-16 02:54:51
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
ans = 0
N2=N
while M>1 and N>0:
    ans += M
    M = (M+1)>>1
    N-=1
ans += N
if M!=1:
    ans = (1<<N2)-1
print(ans)
0