結果
問題 | No.1793 実数当てゲーム |
ユーザー | 👑 Nachia |
提出日時 | 2021-12-22 00:14:40 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 782 bytes |
コンパイル時間 | 723 ms |
コンパイル使用メモリ | 84,372 KB |
実行使用メモリ | 24,252 KB |
平均クエリ数 | 2230.56 |
最終ジャッジ日時 | 2023-10-13 20:01:42 |
合計ジャッジ時間 | 3,960 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
24,132 KB |
testcase_01 | AC | 29 ms
23,376 KB |
testcase_02 | AC | 115 ms
23,508 KB |
testcase_03 | AC | 115 ms
23,256 KB |
testcase_04 | AC | 116 ms
23,388 KB |
testcase_05 | AC | 119 ms
24,252 KB |
testcase_06 | AC | 105 ms
23,508 KB |
testcase_07 | AC | 108 ms
23,616 KB |
testcase_08 | AC | 108 ms
23,640 KB |
testcase_09 | AC | 108 ms
23,268 KB |
testcase_10 | AC | 109 ms
23,376 KB |
testcase_11 | AC | 106 ms
23,412 KB |
testcase_12 | AC | 117 ms
24,012 KB |
testcase_13 | AC | 128 ms
23,496 KB |
testcase_14 | AC | 128 ms
24,072 KB |
testcase_15 | AC | 113 ms
23,376 KB |
testcase_16 | AC | 128 ms
23,376 KB |
testcase_17 | AC | 116 ms
23,508 KB |
ソースコード
#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; }