結果

問題 No.975 ミスターマックスバリュ
コンテスト
ユーザー phspls
提出日時 2020-01-31 23:39:54
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 868 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 15,405 ms
コンパイル使用メモリ 196,796 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-06 06:25:18
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::Read;
use std::collections::HashSet;

fn main() {
    let mut all_data = String::new();
    std::io::stdin().read_to_string(&mut all_data).ok();
    let all_data: Vec<&str> = all_data.trim().split('\n').map(|s| s.trim()).collect();
    let xnm: Vec<usize> = all_data.iter().next().unwrap().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let a: HashSet<usize> = all_data.iter().skip(1).next().unwrap().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let b: HashSet<usize> = all_data.iter().skip(2).next().unwrap().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let x = xnm[0];
    if a.contains(&x) && b.contains(&x) {
        println!("MrMaxValu");
    } else if a.contains(&x) {
        println!("MrMax");
    } else if b.contains(&x) {
        println!("MaxValu");
    } else {
        println!("-1");
    }
}
0