結果

問題 No.253 ロウソクの長さ
ユーザー lloyzlloyz
提出日時 2023-10-02 00:18:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 87,780 KB
平均クエリ数 35.58
最終ジャッジ日時 2023-10-02 00:18:19
合計ジャッジ時間 7,164 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
87,236 KB
testcase_01 AC 129 ms
87,436 KB
testcase_02 AC 102 ms
87,656 KB
testcase_03 AC 103 ms
87,688 KB
testcase_04 AC 102 ms
87,288 KB
testcase_05 AC 103 ms
87,180 KB
testcase_06 AC 101 ms
87,424 KB
testcase_07 AC 102 ms
87,144 KB
testcase_08 AC 101 ms
86,928 KB
testcase_09 AC 127 ms
87,628 KB
testcase_10 AC 104 ms
87,516 KB
testcase_11 AC 100 ms
87,300 KB
testcase_12 AC 100 ms
87,224 KB
testcase_13 AC 99 ms
87,336 KB
testcase_14 AC 99 ms
87,620 KB
testcase_15 AC 103 ms
87,276 KB
testcase_16 AC 99 ms
87,012 KB
testcase_17 AC 101 ms
86,908 KB
testcase_18 AC 103 ms
87,372 KB
testcase_19 AC 98 ms
87,660 KB
testcase_20 AC 100 ms
87,080 KB
testcase_21 AC 101 ms
87,204 KB
testcase_22 AC 100 ms
87,736 KB
testcase_23 AC 100 ms
87,008 KB
testcase_24 AC 104 ms
87,356 KB
testcase_25 AC 100 ms
87,344 KB
testcase_26 AC 102 ms
87,196 KB
testcase_27 AC 103 ms
87,204 KB
testcase_28 AC 102 ms
87,352 KB
testcase_29 AC 105 ms
86,932 KB
testcase_30 AC 101 ms
87,020 KB
testcase_31 AC 102 ms
87,780 KB
testcase_32 AC 100 ms
87,496 KB
testcase_33 AC 102 ms
87,748 KB
testcase_34 AC 98 ms
87,396 KB
testcase_35 AC 101 ms
87,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def ask(x):
    print(f"? {x}")
    return int(input())

x = ask(98)
if x == 0:
    ans = 98
elif x == -1:
    for i in range(1, 99):
        if ask(0) == 0:
            ans = i
            break
else:
    l = 0
    r = 10**9 + 1
    t = 1
    while r - l > 1:
        mid = (l + r) // 2
        if ask(max(mid - t, 0)) >= 0:
            l = mid
        else:
            r = mid
        t += 1
    ans = l
print(f"! {ans}")
0