結果

問題 No.628 Tagの勢い
ユーザー focusfocus
提出日時 2018-02-10 15:35:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 1,052 ms
コンパイル使用メモリ 89,268 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 20:06:17
合計ジャッジ時間 2,881 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
using namespace std;
int main(){
    int n,x,M,S;
    string tag;
    map<string,int> cnt;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> x >> M >> S;
        while(M--){
            cin >> tag;
            cnt[tag] += S;
        }
    }
    vector<pair<int,string>> v;
    for(auto au:cnt){
        v.emplace_back(-au.second,au.first);
    }
    sort(v.begin(),v.end());
    for(int i=0;i<n;i++){
        cout << v[i].second << " " << -v[i].first << endl;
    }
    return 0;
}
0