結果

問題 No.934 Explosive energy drink
ユーザー phsplsphspls
提出日時 2020-01-25 12:08:01
言語 Rust
(1.77.0)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 7,283 ms
コンパイル使用メモリ 140,736 KB
実行使用メモリ 24,360 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:30:45
合計ジャッジ時間 10,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
23,652 KB
testcase_01 AC 318 ms
23,652 KB
testcase_02 AC 28 ms
23,676 KB
testcase_03 AC 178 ms
24,048 KB
testcase_04 AC 319 ms
24,048 KB
testcase_05 AC 26 ms
23,436 KB
testcase_06 AC 26 ms
23,568 KB
testcase_07 AC 25 ms
23,652 KB
testcase_08 AC 25 ms
23,652 KB
testcase_09 AC 25 ms
23,424 KB
testcase_10 AC 26 ms
23,916 KB
testcase_11 AC 26 ms
23,856 KB
testcase_12 AC 30 ms
23,676 KB
testcase_13 AC 31 ms
23,688 KB
testcase_14 AC 31 ms
23,856 KB
testcase_15 AC 106 ms
23,436 KB
testcase_16 AC 43 ms
24,060 KB
testcase_17 AC 67 ms
24,060 KB
testcase_18 AC 75 ms
24,360 KB
testcase_19 AC 130 ms
24,288 KB
testcase_20 AC 216 ms
24,048 KB
testcase_21 AC 239 ms
24,048 KB
testcase_22 AC 315 ms
23,844 KB
testcase_23 AC 316 ms
23,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse::<usize>().unwrap();
    let mut result: Vec<usize> = vec![];
    for i in 1..=n {
        println!("? {}", n - 1);
        println!("{}", (1..=n).filter(|j| j != &i).map(|j| j.to_string()).collect::<Vec<String>>().join(" "));
        let mut a = String::new();
        std::io::stdin().read_line(&mut a).ok();
        match a.trim() {
            "0" => { result.push(i); },
            _ => { },
        };
    }
    println!("! {}", result.len());
    println!("{}", result.iter().map(|i| i.to_string()).collect::<Vec<String>>().join(" "));
    std::process::exit(0);
}
0