結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー imulanimulan
提出日時 2016-11-18 23:49:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,365 bytes
コンパイル時間 2,552 ms
コンパイル使用メモリ 195,820 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 19:01:07
合計ジャッジ時間 2,877 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

typedef pair<int,int> pi;
typedef pair<pi,string> P;
int score(int l,int ac)
{
    return 50*l + (int)(50*l/(0.8+0.2*ac));
}

int main()
{
    int n;
    scanf(" %d", &n);
    vector<int> L(n);
    rep(i,n) scanf( "%d", &L[i]);

    vector<int> ac(n,0);
    map<string,vector<int>> mp;
    map<string,int> last;

    int T;
    scanf(" %d", &T);
    rep(i,T)
    {
        string name;
        char p;
        cin >>name >>p;

        int num=p-'A';
        ++ac[num];

        if(mp.find(name)==mp.end()) mp[name]=vector<int>(n,0);
        last[name]=i;

        mp[name][num]=score(L[num],ac[num]);
    }

    vector<P> v;
    for(const auto &m:mp)
    {
        string name=m.fi;
        vector<int> t=m.se;

        int sum=0;
        rep(i,n) sum+=t[i];

        v.pb(P(pi(-sum,last[name]),name));
    }
    sort(all(v));

    rep(i,v.size())
    {
        string name=v[i].se;

        printf("%d ", i+1);
        cout << name << " ";

        vector<int> t=mp[name];
        rep(j,n) printf("%d ", t[j]);
        printf("%d\n", -v[i].fi.fi);
    }
    return 0;
}
0