結果

問題 No.975 ミスターマックスバリュ
ユーザー akakimidoriakakimidori
提出日時 2020-01-31 21:28:54
言語 Rust
(1.72.1)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 622 bytes
コンパイル時間 2,352 ms
コンパイル使用メモリ 159,160 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 08:44:00
合計ジャッジ時間 3,008 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

use std::io::Read;

fn run() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let it = s.trim().split_whitespace();
    let a: Vec<usize> = it.map(|s| s.parse().unwrap()).collect();
    let (x, n, m) = (a[0], a[1], a[2]);
    let (a, b) = a[3..].split_at(n);
    assert!(b.len() == m);
    let ans = match (a.iter().position(|d| *d == x), b.iter().position(|d| *d == x)) {
        (Some(_), Some(_)) => "MrMaxValu",
        (Some(_), None) => "MrMax",
        (None, Some(_)) => "MaxValu",
        (None, None) => "-1",
    };
    println!("{}", ans);
}

fn main() {
    run();
}
0