結果

問題 No.1793 実数当てゲーム
ユーザー とりゐとりゐ
提出日時 2021-11-17 16:24:26
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 629 bytes
コンパイル時間 1,370 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 97,536 KB
平均クエリ数 327.78
最終ジャッジ日時 2023-10-13 19:56:22
合計ジャッジ時間 7,350 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
86,968 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 262 ms
94,240 KB
testcase_06 AC 253 ms
93,660 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
権限があれば一括ダウンロードができます

ソースコード

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('?',mid)
    stdout.flush()
    s=input()
    if s=='Yes':
      l=mid
    else:
      r=mid
  print('!',(l+r)/2)
  stdout.flush()

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