結果

問題 No.2153 何コーダーが何人?
ユーザー yicode
提出日時 2023-05-15 10:50:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 175,384 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 17:46:07
合計ジャッジ時間 3,064 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:14:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   14 |     for (const auto& [key, value] : dic) {
      |                      ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
    int N; cin >> N;
    map<string,int> dic;
    vector<int> A(8,0);
    for(int i = 0; i < N; i++) {
        string S; cin >> S;
        int a; cin >> a;
        dic[S] = a;
    }
    for (const auto& [key, value] : dic) {
        A[value]++;
    }
    for(int i = 0; i < 8; i++) {
        cout << A[i] << endl;
    }
}
0