結果
| 問題 | No.628 Tagの勢い | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-07-12 17:06:13 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 16 ms / 2,000 ms | 
| コード長 | 854 bytes | 
| コンパイル時間 | 1,555 ms | 
| コンパイル使用メモリ | 126,044 KB | 
| 最終ジャッジ日時 | 2025-01-11 20:03:09 | 
| ジャッジサーバーID (参考情報) | judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
using namespace std;
typedef long long int ll;
using ull = unsigned long long;
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int q; cin >> q;
    map<string,int> mp;
    while(q--){
        int id; cin >> id;
        int n; cin >> n;
        int s; cin >> s;
        for(int i=0;i<n;i++){
            string t; cin >> t;
            mp[t]+=s;
        }
    }
    vector<pair<int,string>> v;
    for(auto p:mp){
        v.push_back(make_pair(-p.second,p.first));
    }
    sort(v.begin(), v.end());
    for(int i=0;i<min((int)v.size(),10);i++){
        cout << v[i].second <<  " " << -v[i].first << endl;
    }
}
            
            
            
        