結果

問題 No.1032 数数え
ユーザー oooooba
提出日時 2021-05-26 22:35:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 351 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 1,094 ms
コンパイル使用メモリ 115,000 KB
最終ジャッジ日時 2025-01-21 18:37:53
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t n, m;
    cin >> n >> m;
    vector<int32_t> hist(m + 1);
    for (auto i = 0; i < n; ++i) {
        int32_t l;
        cin >> l;
        if (l <= m)
            ++hist[l];
    }
    for (auto i = 1; i <= m; ++i) {
        cout << i << " " << hist[i] << endl;
    }
    return 0;
}
0