結果

問題 No.628 Tagの勢い
ユーザー chacoder1chacoder1
提出日時 2021-05-10 12:51:41
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 210,124 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 21:23:45
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 5 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 4 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 AC 4 ms
4,348 KB
testcase_08 AC 11 ms
4,348 KB
testcase_09 AC 6 ms
4,348 KB
testcase_10 AC 7 ms
4,348 KB
testcase_11 AC 6 ms
4,348 KB
testcase_12 AC 18 ms
4,348 KB
testcase_13 AC 18 ms
4,348 KB
testcase_14 AC 18 ms
4,348 KB
testcase_15 AC 18 ms
4,348 KB
testcase_16 AC 17 ms
4,348 KB
testcase_17 AC 3 ms
4,348 KB
testcase_18 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define int long long

signed main(){
  int n;
  cin>>n;
  map<string,int>mp;
  rep(i,n){
    int gazo;
    cin>>gazo;
    int m,pnt;
    cin>>m>>pnt;
    string tag;
    rep(i,m){
      cin>>tag;
      mp[tag]+=pnt;
    }
  }
  int cnt=0;
  for(int i=10000;i>=0;i--){
    for(auto e:mp){
      if(e.second==i){
        cout<<e.first<<" "<<i<<endl;
        cnt++;
        if(cnt==10){
          return 0;
        }
      }
    }
  }
  return 0;
}
0