結果
問題 | No.1032 数数え |
ユーザー |
|
提出日時 | 2023-09-22 23:48:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 378 ms / 2,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 686 ms |
コンパイル使用メモリ | 79,252 KB |
最終ジャッジ日時 | 2025-02-17 01:11:26 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <map> using namespace std; int main(void){ int n, m; cin >> n >> m; map<int, int> mp; int l; for (int i = 0; i < n; i++) { cin >> l; if (l <= m) { if (mp.find(l) == mp.end()) { mp.insert(make_pair(l, 1)); } else mp[l]++; } } for (int i = 1; i <= m; i++) { cout << i << " " << mp[i] << endl; } }