結果

問題 No.1286 Stone Skipping
コンテスト
ユーザー rlangevin
提出日時 2023-04-04 12:32:16
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 237 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 58,496 KB
最終ジャッジ日時 2026-04-17 05:36:25
合計ジャッジ時間 7,949 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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