結果
| 問題 |
No.628 Tagの勢い
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-27 03:16:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 599 bytes |
| コンパイル時間 | 2,306 ms |
| コンパイル使用メモリ | 212,312 KB |
| 最終ジャッジ日時 | 2025-02-07 16:51:42 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N; cin >> N;
map<string,int> mp;
rep(_,N) {
int No; cin >> No;
int M, S; cin >> M >> S;
rep(i,M) {
string Tag; cin >> Tag;
mp[Tag] += S;
}
}
vector<pair<int,string>> v;
for(auto e : mp) v.push_back({-e.second, e.first});
sort(v.begin(), v.end());
rep(i,min(int(v.size()), 10)) cout << v[i].second << " " << -v[i].first << endl;
}