結果

問題 No.1793 実数当てゲーム
ユーザー ShirotsumeShirotsume
提出日時 2021-12-22 01:28:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 24,888 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 20:35:32
合計ジャッジ時間 4,285 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
24,408 KB
testcase_01 AC 46 ms
24,200 KB
testcase_02 AC 154 ms
24,460 KB
testcase_03 AC 151 ms
24,544 KB
testcase_04 AC 153 ms
24,612 KB
testcase_05 AC 146 ms
24,656 KB
testcase_06 AC 147 ms
24,624 KB
testcase_07 AC 146 ms
24,888 KB
testcase_08 AC 147 ms
24,484 KB
testcase_09 AC 148 ms
24,724 KB
testcase_10 AC 149 ms
24,380 KB
testcase_11 AC 148 ms
24,356 KB
testcase_12 AC 153 ms
24,356 KB
testcase_13 AC 155 ms
24,452 KB
testcase_14 AC 155 ms
24,356 KB
testcase_15 AC 152 ms
24,880 KB
testcase_16 AC 156 ms
24,604 KB
testcase_17 AC 152 ms
24,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def query(x):
        print('?', '{0:.10f}'.format(x),flush=True)
        s = input()
        if s == '-1':
            raise Exception
        return True if s == 'Yes' else False
import random
from math import log10
def solve():
    upper = log10(12.22) + 74
    lower = -6
    for _ in range(24):
        now = (lower + upper) / 2
        if query(pow(10,now)):
            lower = now
        else:
            upper = now
    print('!', '{0:.10f}'.format(pow(10, (upper + lower)/2)),flush=True)


t = int(input())
for _ in range(t):
    solve()

0