結果

問題 No.1793 実数当てゲーム
ユーザー chineristACchineristAC
提出日時 2021-12-22 01:39:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 427 ms / 2,000 ms
コード長 916 bytes
コンパイル時間 1,341 ms
コンパイル使用メモリ 87,628 KB
実行使用メモリ 112,176 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 20:38:24
合計ジャッジ時間 9,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 277 ms
108,708 KB
testcase_01 AC 275 ms
108,704 KB
testcase_02 AC 427 ms
111,780 KB
testcase_03 AC 406 ms
111,352 KB
testcase_04 AC 424 ms
111,952 KB
testcase_05 AC 408 ms
111,756 KB
testcase_06 AC 402 ms
111,692 KB
testcase_07 AC 414 ms
111,956 KB
testcase_08 AC 395 ms
112,036 KB
testcase_09 AC 396 ms
111,316 KB
testcase_10 AC 401 ms
111,672 KB
testcase_11 AC 407 ms
112,176 KB
testcase_12 AC 412 ms
111,536 KB
testcase_13 AC 403 ms
111,684 KB
testcase_14 AC 406 ms
111,548 KB
testcase_15 AC 415 ms
111,992 KB
testcase_16 AC 406 ms
112,008 KB
testcase_17 AC 420 ms
111,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd
from fractions import Fraction

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

def query(y):
    if y < 100:
        print("? {:.100f}".format(y))
    else:
        print("? {:.100g}".format(y))
    sys.stdout.flush()
    #return True
    res = input()
    assert res!="-1"
    return res=="Yes"

def answer(x):
    if x < 100:
        print("! {:.100f}".format(x))
    else:
        print("! {:.100g}".format(x))
    sys.stdout.flush()

for _ in range(int(input())):
    ok = 10**(-5.5)
    ng = 10**74 * 12.22
    for i in range(24):
        mid = (ok*ng)**.5
        if query(mid):
            ok = mid
        else:
            ng = mid
    mid = (ok*ng)**.5
    answer(mid)
    
0