結果
問題 |
No.975 ミスターマックスバリュ
|
ユーザー |
|
提出日時 | 2020-04-30 12:56:08 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 929 bytes |
コンパイル時間 | 11,449 ms |
コンパイル使用メモリ | 401,092 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 06:06:09 |
合計ジャッジ時間 | 11,773 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let x: usize = itr.next().unwrap().parse().unwrap(); let n: usize = itr.next().unwrap().parse().unwrap(); let m: usize = itr.next().unwrap().parse().unwrap(); let a: Vec<usize> = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let b: Vec<usize> = (0..m) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut c = false; let mut d = false; if let Some(_) = a.iter().find(|&&y| y == x) { c = true; } if let Some(_) = b.iter().find(|&y| *y == x) { d = true; } if c && d { println!("MrMaxValu",) } else if c { println!("MrMax",) } else if d { println!("MaxValu",) } else { println!("-1",) } }