結果
| 問題 | No.628 Tagの勢い |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-11 14:36:29 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 9 ms / 2,000 ms |
| + 134µs | |
| コード長 | 558 bytes |
| 記録 | |
| コンパイル時間 | 1,311 ms |
| コンパイル使用メモリ | 205,348 KB |
| 実行使用メモリ | 9,804 KB |
| 最終ジャッジ日時 | 2026-10-12 13:48:09 |
| 合計ジャッジ時間 | 2,623 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
int main(){
int n,a,m,p; cin>>n;
map<string,int> mp;
rep(i,n){
cin>>a>>m>>p;
rep(j,m){
string s; cin>>s;
mp[s]+=p;
}
}
vector<pair<int,string>> vp;
for(auto x:mp) vp.emplace_back(x.second*-1,x.first);
sort(all(vp));
if(mp.size()>9){
rep(i,10) cout<<vp[i].second<<" "<<vp[i].first*-1<<endl;
}else{
rep(i,mp.size()) cout<<vp[i].second<<" "<<vp[i].first*-1<<endl;
}
}