結果

問題 No.1793 実数当てゲーム
ユーザー ShirotsumeShirotsume
提出日時 2021-12-22 02:08:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 292 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,384 KB
実行使用メモリ 95,216 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 20:40:24
合計ジャッジ時間 6,613 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
88,504 KB
testcase_01 AC 120 ms
88,544 KB
testcase_02 AC 292 ms
95,020 KB
testcase_03 AC 288 ms
94,596 KB
testcase_04 AC 288 ms
95,216 KB
testcase_05 AC 283 ms
94,624 KB
testcase_06 AC 281 ms
94,176 KB
testcase_07 AC 280 ms
94,932 KB
testcase_08 AC 283 ms
94,948 KB
testcase_09 AC 280 ms
94,768 KB
testcase_10 AC 277 ms
94,736 KB
testcase_11 AC 280 ms
94,684 KB
testcase_12 AC 285 ms
94,612 KB
testcase_13 AC 282 ms
94,940 KB
testcase_14 AC 285 ms
95,048 KB
testcase_15 AC 279 ms
94,712 KB
testcase_16 AC 285 ms
95,140 KB
testcase_17 AC 279 ms
94,460 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 = -7
    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