結果
| 問題 | No.253 ロウソクの長さ |
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-06-23 22:18:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 27,864 KB |
| 平均クエリ数 | 29.44 |
| 最終ジャッジ日時 | 2024-07-17 03:52:50 |
| 合計ジャッジ時間 | 7,690 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 36 |
ソースコード
import sys
input=lambda: sys.stdin.readline().rstrip()
l,r=10,10**9
ct=0
while r-l>1:
mid=(l+r)//2
print("?"+str(max(0,mid-ct)),flush=True)
ct+=1
ans=int(input())
if ans==0:
print("!"+str(max(0,mid-ct)),flush=True)
break
elif ans==1:
l=mid
else:
r=mid
else:
print("?"+str(max(0,r-ct)),flush=True)
ct+=1
if ans==0:
print("!"+str(max(0,r-ct)),flush=True)
else:
print("!"+str(max(0,l-ct)),flush=True)
takakin