結果

問題 No.1032 数数え
ユーザー
提出日時 2024-06-03 16:31:13
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 14,497 ms
コンパイル使用メモリ 379,908 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2024-12-23 10:38:50
合計ジャッジ時間 13,361 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::{collections::HashMap, io::Read};

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let v: Vec<u32> = s.split_whitespace().flat_map(str::parse).collect();
	let mut h = HashMap::new();
	for &l in &v[2..] {
		*h.entry(l).or_insert(0) += 1;
	}
	for i in 1..=v[1] {
		println!("{} {}", i, h.entry(i).or_default());
	}
}
0