結果

問題 No.1286 Stone Skipping
ユーザー KudeKude
提出日時 2020-11-21 12:05:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 1,314 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 76,516 KB
最終ジャッジ日時 2023-09-30 21:43:17
合計ジャッジ時間 5,095 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,372 KB
testcase_01 AC 74 ms
75,212 KB
testcase_02 AC 82 ms
76,120 KB
testcase_03 AC 79 ms
76,424 KB
testcase_04 AC 80 ms
76,212 KB
testcase_05 AC 80 ms
76,308 KB
testcase_06 AC 79 ms
76,056 KB
testcase_07 AC 79 ms
76,216 KB
testcase_08 AC 80 ms
76,452 KB
testcase_09 AC 79 ms
76,264 KB
testcase_10 AC 82 ms
76,128 KB
testcase_11 AC 83 ms
76,256 KB
testcase_12 AC 81 ms
76,452 KB
testcase_13 AC 81 ms
76,236 KB
testcase_14 AC 82 ms
76,284 KB
testcase_15 AC 82 ms
76,296 KB
testcase_16 AC 82 ms
76,244 KB
testcase_17 AC 82 ms
76,276 KB
testcase_18 AC 74 ms
75,220 KB
testcase_19 AC 76 ms
75,188 KB
testcase_20 AC 81 ms
76,324 KB
testcase_21 AC 82 ms
76,252 KB
testcase_22 AC 82 ms
76,116 KB
testcase_23 AC 81 ms
76,248 KB
testcase_24 AC 84 ms
76,372 KB
testcase_25 AC 83 ms
76,516 KB
testcase_26 AC 83 ms
76,132 KB
testcase_27 AC 81 ms
76,264 KB
testcase_28 AC 79 ms
76,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
def dist(x, i):
    res = x
    for _ in range(i):
        x //= 2
        res += x
    return res
ans = d
for i in range(100):
    l, r = 0, d
    while r - l > 1:
        c = (l + r) // 2
        if dist(c, i) >= d:
            r = c
        else:
            l = c
    if dist(r, i) == d:
        ans = min(ans, r)
print(ans)
0