結果
問題 | No.253 ロウソクの長さ |
ユーザー | 👑 rin204 |
提出日時 | 2022-11-02 16:41:34 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 445 ms |
コンパイル使用メモリ | 87,088 KB |
実行使用メモリ | 87,884 KB |
平均クエリ数 | 35.67 |
最終ジャッジ日時 | 2023-09-24 05:38:52 |
合計ジャッジ時間 | 8,923 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 96 ms
86,964 KB |
testcase_02 | AC | 100 ms
87,112 KB |
testcase_03 | AC | 96 ms
87,324 KB |
testcase_04 | AC | 94 ms
87,308 KB |
testcase_05 | AC | 97 ms
86,872 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 94 ms
87,420 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 91 ms
87,600 KB |
testcase_15 | AC | 98 ms
87,236 KB |
testcase_16 | AC | 95 ms
87,508 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 93 ms
87,016 KB |
testcase_20 | WA | - |
testcase_21 | AC | 96 ms
86,980 KB |
testcase_22 | AC | 95 ms
86,920 KB |
testcase_23 | WA | - |
testcase_24 | AC | 96 ms
87,136 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 94 ms
87,060 KB |
testcase_35 | WA | - |
ソースコード
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: l = mid else: r = mid t += 1 print("!", r, flush=True)