結果
問題 | No.253 ロウソクの長さ |
ユーザー |
![]() |
提出日時 | 2016-08-28 03:31:57 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 573 bytes |
コンパイル時間 | 284 ms |
コンパイル使用メモリ | 82,216 KB |
実行使用メモリ | 71,156 KB |
平均クエリ数 | 30.69 |
最終ジャッジ日時 | 2024-07-16 10:55:42 |
合計ジャッジ時間 | 10,187 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 35 |
ソースコード
import sys def ask(y): print("?", y) sys.stdout.flush() ret = int(input()) return ret def ans(y): print("!", y) sys.stdout.flush() exit() if ask(80) == 0: ans(80) elif ask(80) == -1: for i in range(80): if ask(9) == 0: ans(9 + i + 1) else: high = 10 ** 9 low = 80 num = 1 while low < high: mid = (low + high) // 2 x = ask(mid - num) if x == 0: ans(mid) elif x == -1: high = mid else: low = mid + 1 num += 1