結果
問題 | No.253 ロウソクの長さ |
ユーザー | 👑 rin204 |
提出日時 | 2022-11-02 16:39:15 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 363 ms |
コンパイル使用メモリ | 86,960 KB |
実行使用メモリ | 95,200 KB |
平均クエリ数 | 34.28 |
最終ジャッジ日時 | 2023-09-24 05:36:10 |
合計ジャッジ時間 | 9,705 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | AC | 98 ms
87,308 KB |
testcase_02 | AC | 100 ms
86,940 KB |
testcase_03 | AC | 96 ms
86,892 KB |
testcase_04 | AC | 95 ms
87,672 KB |
testcase_05 | AC | 99 ms
87,312 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 96 ms
87,608 KB |
testcase_10 | RE | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 94 ms
87,124 KB |
testcase_15 | AC | 99 ms
87,172 KB |
testcase_16 | AC | 97 ms
87,032 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 95 ms
87,028 KB |
testcase_20 | RE | - |
testcase_21 | AC | 97 ms
87,396 KB |
testcase_22 | AC | 97 ms
86,880 KB |
testcase_23 | WA | - |
testcase_24 | AC | 98 ms
87,584 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 | 95 ms
87,116 KB |
testcase_35 | RE | - |
ソースコード
def ask(x): print("?", x, flush=True) return int(input()) x = ask(99) if x == 0: print("!", 99, flush=True) elif x == -1: for i in range(1, 100): 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)