結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ei1333333ei1333333
提出日時 2016-11-18 22:37:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 940 bytes
コンパイル時間 1,681 ms
コンパイル使用メモリ 179,312 KB
実行使用メモリ 7,872 KB
最終ジャッジ日時 2023-08-17 11:07:54
合計ジャッジ時間 3,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,500 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 5 ms
4,380 KB
testcase_04 AC 5 ms
4,376 KB
testcase_05 AC 16 ms
4,504 KB
testcase_06 AC 28 ms
6,708 KB
testcase_07 AC 12 ms
4,376 KB
testcase_08 AC 16 ms
4,952 KB
testcase_09 AC 25 ms
5,884 KB
testcase_10 AC 5 ms
4,380 KB
testcase_11 AC 7 ms
4,380 KB
testcase_12 AC 10 ms
4,376 KB
testcase_13 AC 21 ms
5,360 KB
testcase_14 AC 26 ms
5,832 KB
testcase_15 AC 8 ms
4,380 KB
testcase_16 AC 7 ms
4,380 KB
testcase_17 AC 6 ms
4,376 KB
testcase_18 AC 3 ms
4,376 KB
testcase_19 AC 38 ms
7,872 KB
testcase_20 AC 28 ms
6,100 KB
testcase_21 AC 9 ms
4,380 KB
testcase_22 AC 7 ms
4,380 KB
testcase_23 AC 10 ms
4,376 KB
testcase_24 AC 25 ms
6,172 KB
testcase_25 AC 35 ms
7,284 KB
testcase_26 AC 15 ms
4,628 KB
testcase_27 AC 13 ms
4,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

int f(int N, int K)
{
  return (50 * N + (50 * N) / (0.8 + 0.2 * K));
}

int main()
{
  int N, L[26], T, rank[26] = {};

  cin >> N;
  for(int i = 0; i < N; i++) {
    cin >> L[i];
  }
  cin >> T;

  map< string, map< int, int > > ranker;
  map< string, int > last;
  map< string, int > sum;

  for(int i = 0; i < T; i++) {
    string S;
    char P;
    cin >> S >> P;
    P -= 'A';
    ranker[S][P] = f(L[P], ++rank[P]);
    last[S] = i;
    sum[S] += ranker[S][P];
  }

  vector< pair< pair< int, int >, string > > name;
  for(auto &c: sum) name.push_back({{c.second, -last[c.first]}, c.first});
  sort(begin(name), end(name));
  reverse(begin(name), end(name));

  for(int i = 0; i < name.size(); i++) {
    auto &obj = name[i];
    cout << i + 1 << " " << obj.second;
    for(int j = 0; j < N; j++) cout << " " << ranker[obj.second][j];
    cout << " " << obj.first.first << endl;
  }
}


0