結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー okayunonahaokayunonaha
提出日時 2016-11-19 00:15:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,481 bytes
コンパイル時間 825 ms
コンパイル使用メモリ 65,524 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 19:17:03
合計ジャッジ時間 1,993 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 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 <iostream>
#include <string>
#include <algorithm>
using namespace std;

struct grd {
    string name;
    int last_ac, point;
    int p[27];
};

int N, L[27], Lsub[27], T, g_size = 0;
grd g[4002];

bool comp(const grd &g1, const grd &g2) {
    if(g1.point == g2.point) return g1.last_ac < g2.last_ac;
    return g1.point > g2.point;
}


int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    fill(Lsub, Lsub + 27, 1);
    string n;
    char p;
    bool flag = false;

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

        for(int j = 0; j < g_size; ++j) {
            if(g[j].name == n) {
                g[j].p[p - 'A'] = 50*L[p-'A'] + (int)(50*L[p-'A'] / (0.8 + 0.2 * Lsub[p-'A']++));
                g[j].point+=g[j].p[p-'A'];
                g[j].last_ac = i;
                flag = true;
            }
        }
        if(!flag) {
            g[g_size].name = n;
            g[g_size].p[p-'A'] = 50*L[p-'A'] + (int)(50*L[p-'A'] / (0.8 + 0.2 * Lsub[p-'A']++));
            g[g_size].point+=g[g_size].p[p-'A'];
            g[g_size].last_ac = i;
            g_size++;
        }
    }

    sort(g, g + g_size, comp);

    for(int i = 0; i < g_size; ++i) {
        cout << i+1 << " " << g[i].name << " ";
        for(int j = 0; j < N; ++j) {
            cout << g[i].p[j] << " ";
        }
        cout << g[i].point << endl;
    }
}
0