結果

問題 No.1286 Stone Skipping
ユーザー O2MTO2MT
提出日時 2020-11-18 00:32:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 76,744 KB
最終ジャッジ日時 2023-09-30 16:14:04
合計ジャッジ時間 4,112 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,072 KB
testcase_01 AC 77 ms
76,084 KB
testcase_02 AC 81 ms
76,644 KB
testcase_03 AC 80 ms
76,636 KB
testcase_04 AC 80 ms
76,640 KB
testcase_05 AC 82 ms
76,544 KB
testcase_06 AC 80 ms
76,576 KB
testcase_07 AC 80 ms
76,636 KB
testcase_08 AC 81 ms
76,364 KB
testcase_09 AC 80 ms
76,356 KB
testcase_10 AC 81 ms
76,724 KB
testcase_11 AC 81 ms
76,400 KB
testcase_12 AC 82 ms
76,292 KB
testcase_13 AC 83 ms
76,360 KB
testcase_14 AC 83 ms
76,556 KB
testcase_15 AC 81 ms
76,288 KB
testcase_16 AC 79 ms
76,460 KB
testcase_17 AC 82 ms
76,452 KB
testcase_18 AC 76 ms
75,864 KB
testcase_19 AC 79 ms
76,276 KB
testcase_20 AC 82 ms
76,744 KB
testcase_21 AC 80 ms
76,436 KB
testcase_22 AC 81 ms
76,632 KB
testcase_23 AC 82 ms
76,592 KB
testcase_24 AC 82 ms
76,632 KB
testcase_25 AC 81 ms
76,460 KB
testcase_26 AC 79 ms
76,460 KB
testcase_27 AC 79 ms
76,224 KB
testcase_28 AC 80 ms
76,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

D = int(input())
K = 64
ans = D
for k in range(1,K+1):
    high = D
    low = 0
    while abs(high - low) > 1:
        mid = (high+low)//2
        dist = 0
        x = mid
        for n in range(k):
            dist += x
            x //= 2
        if dist >= D:
            high = mid
        else:
            low = mid
    v = 0
    x = high
    for i in range(k):
        v += x
        x //= 2
    if (v == D):
        ans = high
print(ans)
0