結果
問題 | No.706 多眼生物の調査 |
ユーザー |
![]() |
提出日時 | 2022-12-19 19:38:19 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 540 bytes |
コンパイル時間 | 14,578 ms |
コンパイル使用メモリ | 388,520 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 01:15:09 |
合計ジャッジ時間 | 14,926 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
use std::collections::HashMap;fn main() {let mut xx = String::new();std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok();let xx: Vec<&str> = xx.split_whitespace().skip(1).collect();let mut count = HashMap::new();for &x in &xx {*count.entry(x.len() - 2).or_insert(0) += 1;}let max = *count.values().max().unwrap();let answer = count.iter().filter(|(_, &n)| n == max).map(|(&l, _)| l).max().unwrap();println!("{answer}");}