結果

問題 No.1869 Doubling?
コンテスト
ユーザー qwewe
提出日時 2025-04-24 12:20:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 226 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 83,200 KB
最終ジャッジ日時 2026-07-10 04:48:29
合計ジャッジ時間 29,876 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

sum_total = 0
current = 1

for step in range(1, N + 1):
    remaining = N - step
    if remaining >= 30:
        max_x = 1
    else:
        power = 1 << remaining  # 2^remaining
        max_x = (M + power - 1) // power
    next_val = min(2 * current, max_x)
    sum_total += next_val
    current = next_val

print(sum_total)
0