結果
| 問題 |
No.628 Tagの勢い
|
| コンテスト | |
| ユーザー |
yuruhiya
|
| 提出日時 | 2019-04-21 22:50:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 1,004 bytes |
| コンパイル時間 | 2,045 ms |
| コンパイル使用メモリ | 186,972 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-07 23:04:34 |
| 合計ジャッジ時間 | 2,961 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
int main() {
map<string, int> ma;
int n; cin >> n;
rep(i, n) {
int no; cin >> no;
int m, s; cin >> m >> s;
rep(i, m) {
string str; cin >> str;
ma[str] += s;
}
}
vector<pair<int, string>> ve;
for (auto aa : ma) {
ve.pb(mp(-aa.second, aa.first));
}
sort(all(ve));
rep(i, min(10, sz(ve))) {
cout << ve[i].second << " " << -ve[i].first << endl;
}
}
yuruhiya