結果
| 問題 | No.628 Tagの勢い | 
| コンテスト | |
| ユーザー |  mag | 
| 提出日時 | 2020-10-13 12:51:59 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 870 bytes | 
| コンパイル時間 | 1,782 ms | 
| コンパイル使用メモリ | 185,024 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-20 18:25:38 | 
| 合計ジャッジ時間 | 2,807 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 WA * 13 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define r1(i,n) for(int i=0;i<(n);i++)
#define r2(i,a,n) for(int i=(a);i<(n);i++)
#define r5(n)for(;n>0;n--)
#define re(i,a) for(auto &i:a)
int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  //これがN回繰り返される
  int n;cin>>n;
  map<string,int> map;
  r5(n){
    //一つのデータセットは1行目に画像No
    //2行目に画像についているタグの種類数Mとその画像の得点S
    int no,m,s;cin>>no>>m>>s;
    //3行目に画像についているタグが文字以上20文字以下の英単語が記述されます。
    string t;
    r5(m){
      cin>>t;
      map[t]+=s;
    }
  }
  vector<pair<int,string>> pr;
  re(p,map)pr.push_back({-p.second,p.first});
  sort(pr.begin(),pr.end());
  re(i,pr){
    cout<<i.second<<" "<<-i.first<<endl;
  }
}
            
            
            
        