結果

問題 No.1793 実数当てゲーム
ユーザー akakimidoriakakimidori
提出日時 2021-12-22 04:24:46
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 5,333 ms
コンパイル使用メモリ 132,780 KB
実行使用メモリ 24,480 KB
平均クエリ数 2230.56
最終ジャッジ日時 2023-10-13 21:11:49
合計ジャッジ時間 6,453 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
24,324 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 93 ms
23,352 KB
testcase_06 AC 93 ms
23,556 KB
testcase_07 AC 93 ms
23,664 KB
testcase_08 AC 93 ms
23,532 KB
testcase_09 AC 91 ms
23,556 KB
testcase_10 AC 92 ms
24,312 KB
testcase_11 AC 93 ms
23,964 KB
testcase_12 AC 94 ms
23,316 KB
testcase_13 AC 93 ms
23,652 KB
testcase_14 AC 93 ms
23,760 KB
testcase_15 AC 93 ms
23,472 KB
testcase_16 AC 93 ms
23,316 KB
testcase_17 AC 92 ms
24,204 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 10f64.powi(-5);
    let mut r = 12.22f64 * 10f64.powi(74);
    for _ in 0..24 {
        let m = (l * r).sqrt();
        println!("? {}", m);
        let ans = read();
        match ans.as_str() {
            "Yes" => l = m,
            "No" => r = m,
            _ => unreachable!(),
        }
    }
    println!("! {}", (l * r).sqrt());
}

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