結果

問題 No.975 ミスターマックスバリュ
ユーザー j0tdj0td
提出日時 2020-03-20 20:15:05
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 731 bytes
コンパイル時間 18,843 ms
コンパイル使用メモリ 403,656 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 17:05:45
合計ジャッジ時間 16,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 8 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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