結果

問題 No.628 Tagの勢い
コンテスト
ユーザー れいん
提出日時 2024-11-21 12:04:39
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 8 ms / 2,000 ms
+ 883µs
コード長 636 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,527 ms
コンパイル使用メモリ 234,556 KB
実行使用メモリ 9,864 KB
最終ジャッジ日時 2026-10-12 14:14:51
合計ジャッジ時間 2,984 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N;
    cin >> N;
    map<string, int> mp;
    for (int i = 0; i < N; i++)
    {
        int No;
        cin >> No;
        int M, S;
        cin >> M >> S;
        for (int j = 0; j < M; j++)
        {
            string T;
            cin >> T;
            mp[T] += S;
        }
    }
    vector<pair<int, string>> ans;
    for (auto m : mp)
    {
        ans.push_back(make_pair(-m.second, m.first));
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < 10 && i < ans.size(); i++)
    {
        cout << ans[i].second << " " << -ans[i].first<<"\n";
    }
}
0