結果

問題 No.253 ロウソクの長さ
ユーザー 👑 rin204rin204
提出日時 2022-11-02 16:40:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 461 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 95,272 KB
平均クエリ数 34.28
最終ジャッジ日時 2023-09-24 05:37:26
合計ジャッジ時間 9,579 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 91 ms
87,192 KB
testcase_02 AC 92 ms
87,108 KB
testcase_03 AC 87 ms
87,628 KB
testcase_04 AC 82 ms
87,876 KB
testcase_05 AC 84 ms
87,284 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 81 ms
87,668 KB
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 83 ms
87,400 KB
testcase_15 AC 85 ms
87,316 KB
testcase_16 AC 85 ms
87,860 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 82 ms
87,264 KB
testcase_20 RE -
testcase_21 AC 87 ms
87,788 KB
testcase_22 AC 82 ms
86,712 KB
testcase_23 WA -
testcase_24 AC 84 ms
87,624 KB
testcase_25 RE -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
testcase_33 RE -
testcase_34 AC 83 ms
87,156 KB
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def ask(x):
    print("?", x, flush=True)
    return int(input())


x = ask(98)
if x == 0:
    print("!", 98, flush=True)
elif x == -1:
    for i in range(1, 99):
        if ask(0) == 0:
            print("!", i, flush=True)
            break
else:
    l = 0
    r = 1 << 30
    t = 1
    while r - l > 1:
        mid = (l + r) // 2
        if ask(mid - t) >= 0:
            r = mid
        else:
            l = mid
        t += 1
    print("!", r, flush=True)
0