結果

問題 No.1793 実数当てゲーム
ユーザー chineristACchineristAC
提出日時 2021-12-22 01:10:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 916 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 26,540 KB
平均クエリ数 1813.67
最終ジャッジ日時 2023-10-13 20:26:47
合計ジャッジ時間 4,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 = Fraction(-10)
    ng = Fraction(log(12.22,10) + 74)
    for i in range(24):
        mid = (ok+ng)/2
        if query(10**mid):
            ok = mid
        else:
            ng = mid
    answer(10**ok)
    
0