結果

問題 No.1869 Doubling?
ユーザー titia
提出日時 2022-03-11 21:37:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 262 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 88,960 KB
最終ジャッジ日時 2024-09-16 01:46:03
合計ジャッジ時間 3,571 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other TLE * 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