結果
問題 |
No.628 Tagの勢い
|
ユーザー |
![]() |
提出日時 | 2024-11-21 12:04:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 636 bytes |
コンパイル時間 | 2,619 ms |
コンパイル使用メモリ | 211,568 KB |
最終ジャッジ日時 | 2025-02-25 05:44:12 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; map<string, int> mp; for (int i = 0; i < N; i++) { int No; cin >> No; int M, S; cin >> M >> S; for (int j = 0; j < M; j++) { string T; cin >> T; mp[T] += S; } } vector<pair<int, string>> ans; for (auto m : mp) { ans.push_back(make_pair(-m.second, m.first)); } sort(ans.begin(), ans.end()); for (int i = 0; i < 10 && i < ans.size(); i++) { cout << ans[i].second << " " << -ans[i].first<<"\n"; } }