結果
| 問題 |
No.628 Tagの勢い
|
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-02-10 15:35:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 590 bytes |
| コンパイル時間 | 1,301 ms |
| コンパイル使用メモリ | 89,152 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-07 22:29:27 |
| 合計ジャッジ時間 | 2,603 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 9 RE * 5 |
ソースコード
#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;
}
focus