結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-27 00:42:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 957 bytes
コンパイル時間 3,156 ms
コンパイル使用メモリ 217,444 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2024-04-26 06:25:57
合計ジャッジ時間 4,387 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 7 ms
6,944 KB
testcase_04 AC 5 ms
6,940 KB
testcase_05 AC 16 ms
6,940 KB
testcase_06 AC 40 ms
7,936 KB
testcase_07 AC 14 ms
6,940 KB
testcase_08 AC 19 ms
6,944 KB
testcase_09 AC 31 ms
6,940 KB
testcase_10 AC 5 ms
6,944 KB
testcase_11 AC 7 ms
6,944 KB
testcase_12 AC 12 ms
6,940 KB
testcase_13 AC 26 ms
6,940 KB
testcase_14 AC 32 ms
6,940 KB
testcase_15 AC 9 ms
6,948 KB
testcase_16 AC 9 ms
6,940 KB
testcase_17 AC 7 ms
6,940 KB
testcase_18 AC 4 ms
6,940 KB
testcase_19 AC 57 ms
10,240 KB
testcase_20 AC 37 ms
7,168 KB
testcase_21 AC 10 ms
6,940 KB
testcase_22 AC 7 ms
6,944 KB
testcase_23 AC 11 ms
6,940 KB
testcase_24 AC 35 ms
7,552 KB
testcase_25 AC 48 ms
9,472 KB
testcase_26 AC 18 ms
6,940 KB
testcase_27 AC 16 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin>>n;
    int l[n];
    for (int i=0;i<n;i++)
        cin>>l[i];
    map<string,int> sum;
    map<string,int> score[n];
    map<string,int> last;
    int cnt[n]{};
    int t;
    cin>>t;
    for (int i=0;i<t;i++) {
        string name;
        char p;
        cin>>name>>p;
        int pnum=p-'A';
        cnt[pnum]++;
        int scr=50*l[pnum]+500*l[pnum]/(8+2*cnt[pnum]);
        sum[name]+=scr;
        score[pnum][name]=scr;
        last[name]=i;
    }
    vector<pair<pair<int,int>,string>> rank;
    for (auto p:sum)
        rank.push_back({{-p.second,last[p.first]},p.first});
    sort(rank.begin(),rank.end());
    for (int i=0;i<rank.size();i++) {
        cout<<i+1<<' ';
        cout<<rank[i].second<<' ';
        for (int j=0;j<n;j++)
            cout<<score[j][rank[i].second]<<' ';
        cout<<sum[rank[i].second]<<endl;
    }
    return 0;
}
0