結果

問題 No.449 ゆきこーだーの雨と雪 (4)
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2017-04-20 12:39:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,515 bytes
コンパイル時間 1,868 ms
コンパイル使用メモリ 176,856 KB
実行使用メモリ 22,676 KB
最終ジャッジ日時 2023-10-23 16:06:28
合計ジャッジ時間 14,499 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
14,816 KB
testcase_01 AC 5 ms
14,820 KB
testcase_02 AC 6 ms
14,816 KB
testcase_03 AC 6 ms
14,840 KB
testcase_04 AC 7 ms
14,844 KB
testcase_05 AC 7 ms
14,844 KB
testcase_06 AC 5 ms
14,840 KB
testcase_07 AC 6 ms
14,840 KB
testcase_08 AC 6 ms
14,844 KB
testcase_09 AC 6 ms
14,836 KB
testcase_10 AC 6 ms
14,840 KB
testcase_11 AC 5 ms
14,844 KB
testcase_12 AC 529 ms
15,452 KB
testcase_13 AC 4,376 ms
22,676 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)




int N, L[30], T;
int M; string Dic[101010];
int ID[101010], Pro[101010];
//-----------------------------------------------------------------------------------
string Name[101010]; char P[101010];
void init() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N;
    rep(i, 0, N) cin >> L[i];
    cin >> T;
    rep(i, 0, T) cin >> Name[i] >> P[i];

    map<string, int> za;
    rep(i, 0, T) za[Name[i]] = 0;
    M = za.size();
    int idx = 0;
    for (auto& p : za) za[p.first] = idx, idx++;
    for (auto& p : za) Dic[p.second] = p.first;

    rep(i, 0, T) {
        ID[i] = za[Name[i]];
        if(P[i] == '?') Pro[i] = -1;
        else Pro[i] = P[i] - 'A';
    }
}
//-----------------------------------------------------------------------------------
int cnt[30];
int E[101010][30];
int sm[101010], lastsub[101010];
int main() {
    init();

    rep(t, 0, T) {
        int id = ID[t];
        int pid = Pro[t];

        if (pid < 0) {
            int ans = 1;
            rep(i, 0, M) if (i != id) {
                if (sm[id] < sm[i]) ans++;
                else if (sm[id] == sm[i] && lastsub[i] < lastsub[id]) ans++;
            }
            printf("%d\n", ans);
        } else {
            int rank = cnt[pid] + 1;
            cnt[pid]++;

            int p = 50 * L[pid] + 500 * L[pid] / (8 + 2 * rank);

            E[id][pid] = p;
            sm[id] += p;
            lastsub[id] = t;
        }
    }
}
0