結果

問題 No.1793 実数当てゲーム
ユーザー ShirotsumeShirotsume
提出日時 2021-12-22 00:57:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 2,061 ms
コンパイル使用メモリ 86,648 KB
実行使用メモリ 94,928 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 20:19:21
合計ジャッジ時間 6,620 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
88,284 KB
testcase_01 AC 124 ms
88,416 KB
testcase_02 AC 295 ms
94,888 KB
testcase_03 AC 285 ms
94,896 KB
testcase_04 AC 284 ms
94,188 KB
testcase_05 AC 280 ms
94,496 KB
testcase_06 AC 278 ms
94,912 KB
testcase_07 AC 278 ms
94,760 KB
testcase_08 AC 281 ms
94,108 KB
testcase_09 AC 289 ms
94,408 KB
testcase_10 AC 281 ms
94,552 KB
testcase_11 AC 287 ms
94,572 KB
testcase_12 AC 287 ms
94,792 KB
testcase_13 AC 289 ms
94,400 KB
testcase_14 AC 295 ms
94,704 KB
testcase_15 AC 285 ms
94,604 KB
testcase_16 AC 290 ms
94,928 KB
testcase_17 AC 288 ms
94,144 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