結果

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

ソースコード

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[0]) {
        "MrMaxValu"
    } else if mr_max_items.contains(&xnm[0]) {
        "MrMax"
    } else if max_valu_items.contains(&xnm[0]) {
        "MaxValu"
    } else {
        "-1"
    };

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