結果
問題 | No.1032 数数え |
ユーザー |
|
提出日時 | 2020-05-01 11:41:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 323 ms / 2,000 ms |
コード長 | 447 bytes |
コンパイル時間 | 648 ms |
コンパイル使用メモリ | 71,524 KB |
最終ジャッジ日時 | 2025-01-10 03:57:00 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <vector> void solve() { int n, m; std::cin >> n >> m; std::vector<int> cnt(m, 0); while (n--) { int x; std::cin >> x; if (x > m) continue; ++cnt[--x]; } for (int i = 0; i < m; ++i) { std::cout << i + 1 << " " << cnt[i] << std::endl; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }