結果

問題 No.1286 Stone Skipping
コンテスト
ユーザー rlangevin
提出日時 2023-04-04 12:32:16
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 62,284 KB
最終ジャッジ日時 2026-09-07 04:53:04
合計ジャッジ時間 2,890 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def check(m):
    now = m
    x = 0
    while now:
        x += now
        now //= 2
    return x

D = int(input())
yes = 10 ** 18
no = 0
while yes - no != 1:
    mid = (yes + no)//2
    if check(mid) >= D:
        yes = mid
    else:
        no = mid

for i in range(yes, yes + 10 ** 6):
    now = i
    x = 0
    while now:
        x += now
        now //= 2
        if x == D:
            print(i)
            exit()
0