結果
問題 |
No.1032 数数え
|
ユーザー |
|
提出日時 | 2020-04-25 15:26:36 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 626 bytes |
コンパイル時間 | 24,424 ms |
コンパイル使用メモリ | 378,376 KB |
実行使用メモリ | 7,936 KB |
最終ジャッジ日時 | 2024-11-07 04:31:49 |
合計ジャッジ時間 | 19,257 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
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 n: usize = itr.next().unwrap().parse().unwrap(); let m: usize = itr.next().unwrap().parse().unwrap(); let l: Vec<usize> = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut b: Vec<usize> = vec![0; 200020]; for i in 0..n { b[l[i]] += 1; } let mut out = Vec::new(); for i in 1..m + 1 { writeln!(out, "{} {}", i, b[i]).ok(); } stdout().write_all(&out).unwrap(); }