結果

問題 No.2153 何コーダーが何人?
ユーザー nono00
提出日時 2022-12-10 07:41:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 926 ms
コンパイル使用メモリ 82,876 KB
最終ジャッジ日時 2025-02-09 09:03:18
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main() {
    int n;
    map<string, int> mp;
    cin >> n;
    for (int i = 0; i < n; i++) {
        string s;
        int color;
        cin >> s >> color;
        mp[s] = color;
    }

    vector<int> ans(8);
    for (auto [s, c]: mp) {
        ans[c]++;
    }

    for (int i = 0; i < 8; i++) {
        cout << ans[i] << endl;
    }
}
0