結果

問題 No.975 ミスターマックスバリュ
ユーザー j0tdj0td
提出日時 2020-03-20 20:15:05
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 731 bytes
コンパイル時間 15,875 ms
コンパイル使用メモリ 402,416 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-08 12:57:40
合計ジャッジ時間 14,429 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 5 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
      .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let xnm: Vec<i32> = read_vec();
    let mr_max_items: HashSet<i32> = read_vec().into_iter().collect();
    let max_valu_items: HashSet<i32> = read_vec().into_iter().collect();

    let ans = if mr_max_items.contains(&xnm[0]) && max_valu_items.contains(&xnm[1]) {
        "MrMaxValu"
    } else if mr_max_items.contains(&xnm[0]) {
        "MrMax"
    } else if max_valu_items.contains(&xnm[0]) {
        "MaxValu"
    } else {
        "-1"
    };

    println!("{}", ans);
}
0