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