結果

問題 No.253 ロウソクの長さ
ユーザー takakin
提出日時 2020-06-23 22:35:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 27,736 KB
平均クエリ数 29.44
最終ジャッジ日時 2024-07-17 03:53:27
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
l,r=10,10**9
ct=0
while r-l>1:
  mid=(l+r)//2
  print("?",max(0,mid-ct),flush=True)
  ct+=1
  ans=int(input())
  if ans==0:
    print("!",mid,flush=True)
    break

  elif ans==1:
    l=mid
  else:
    r=mid
else:
  print("?",max(0,r-ct),flush=True)
  ct+=1
  ans=int(input())
  if ans==0:
    print("!",r,flush=True)
  else:
    print("!",l,flush=True)
0