結果
問題 | No.975 ミスターマックスバリュ |
ユーザー |
![]() |
提出日時 | 2020-01-31 21:28:54 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 622 bytes |
コンパイル時間 | 20,856 ms |
コンパイル使用メモリ | 400,260 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 07:12:23 |
合計ジャッジ時間 | 21,607 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
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(); }