結果

問題 No.1286 Stone Skipping
ユーザー c-yan
提出日時 2020-11-13 21:52:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,696 KB
最終ジャッジ日時 2024-07-22 20:45:35
合計ジャッジ時間 4,404 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 3 WA * 12 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())


def f(x):
    result = 0
    while x != 0 and result < D:
        result += x
        x //= 2
    return result


for i in range(60, 0, -1):
    t = D * (2 ** (i - 1)) // (2 ** i - 1)
    if f(t) == D:
        for j in range(-2, 1):
            if f(t + j) == D:
                print(t)
                exit()
0