結果

問題 No.1793 実数当てゲーム
ユーザー 👑 NachiaNachia
提出日時 2021-12-22 00:15:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 830 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 84,308 KB
実行使用メモリ 24,312 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 20:02:16
合計ジャッジ時間 4,139 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,376 KB
testcase_01 AC 29 ms
23,856 KB
testcase_02 AC 116 ms
23,232 KB
testcase_03 AC 116 ms
23,508 KB
testcase_04 AC 116 ms
24,024 KB
testcase_05 AC 107 ms
23,412 KB
testcase_06 AC 109 ms
23,856 KB
testcase_07 AC 109 ms
23,904 KB
testcase_08 AC 108 ms
23,220 KB
testcase_09 AC 109 ms
23,256 KB
testcase_10 AC 108 ms
23,076 KB
testcase_11 AC 110 ms
23,256 KB
testcase_12 AC 117 ms
23,844 KB
testcase_13 AC 131 ms
23,640 KB
testcase_14 AC 130 ms
23,388 KB
testcase_15 AC 113 ms
23,520 KB
testcase_16 AC 129 ms
23,664 KB
testcase_17 AC 116 ms
24,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 日本語を読めてませんでした…

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
    cout.precision(10);
    fixed(cout);
    int T; cin >> T;
    while(T--){
        double l = -6.0 * log(10);
        double r = log(12.2199999) + 74.0 * log(10);
        rep(t,24){
            double m = (l+r) / 2;
            double em = exp(m);
            cout << "? " << em << endl << flush;
            string res; cin >> res;
            if(res == "-1") return 0;
            if(res == "Yes") l = m;
            else r = m;
        }
        double m = (l+r)/2;
        cout << "! " << exp(m) << endl << flush;
    }
    return 0;
}
0