結果

問題 No.1793 実数当てゲーム
ユーザー akakimidoriakakimidori
提出日時 2021-12-22 04:14:24
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 597 bytes
コンパイル時間 4,145 ms
コンパイル使用メモリ 143,800 KB
実行使用メモリ 35,088 KB
平均クエリ数 8.33
最終ジャッジ日時 2023-10-13 20:55:01
合計ジャッジ時間 9,041 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

fn read() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    String::from(s.trim())
}

fn run() {
    let mut l = 1f64.powi(-5);
    let mut r = 12.22e74;
    for _ in 0..24 {
        let m = (l * r).sqrt();
        println!("? {:.100000}", m);
        let ans = read();
        match ans.as_str() {
            "Yes" => r = m,
            "No" => l = m,
            _ => unreachable!(),
        }
    }
    println!("! {:.100000}", (l * r).sqrt());
}

fn main() {
    let t = read().parse::<u32>().unwrap();
    for _ in 0..t {
        run();
    }
}
0