結果

問題 No.1869 Doubling?
ユーザー titia
提出日時 2022-03-11 21:38:17
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 262 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 81,992 KB
実行使用メモリ 761,216 KB
最終ジャッジ日時 2024-09-16 01:46:30
合計ジャッジ時間 3,910 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other MLE * 1 -- * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())

if N<=100 and M>=2**(N-1):
    print(2**N-1)
    exit()

ANS=[M]
while len(ANS)<N:
    x=ANS[-1]

    if x%2==0:
        ANS.append(x//2)
    else:
        ANS.append((x+1)//2)

print(sum(ANS))
0