結果

問題 No.1793 実数当てゲーム
ユーザー とりゐとりゐ
提出日時 2021-11-17 16:30:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 665 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 94,820 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 19:56:41
合計ジャッジ時間 6,051 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
87,468 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 256 ms
94,380 KB
testcase_06 AC 260 ms
93,912 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 277 ms
94,624 KB
testcase_14 AC 264 ms
93,780 KB
testcase_15 WA -
testcase_16 AC 274 ms
93,500 KB
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdout
'''
2^24=16777216=1.67*10^7 なので普通に二分探索をすると不十分
y が小さいなら絶対誤差が 10^-5 以下,大きいなら相対誤差が 10^-5 以下になるようにしてやるといい
最初に 167 で二分探索を行ってみる
'''
def solve():
  print('?',167)
  stdout.flush()
  s=input()
  if s=='Yes':
    l,r=167,1222*10**72
  else:
    l,r=0,167
  for i in range(23):
    mid=(l+r)/2
    print('?','{:.06f}'.format(mid))
    stdout.flush()
    s=input()
    if s=='Yes':
      l=mid
    else:
      r=mid
  print('!','{:.06f}'.format((l+r)/2))
  stdout.flush()

t=int(input())
while t:
  solve()
  t-=1
0