結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー firiexpfiriexp
提出日時 2019-08-21 18:50:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 1,465 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 121,376 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 15:43:46
合計ジャッジ時間 2,894 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 4 ms
6,940 KB
testcase_04 AC 4 ms
6,940 KB
testcase_05 AC 10 ms
6,940 KB
testcase_06 AC 12 ms
6,944 KB
testcase_07 AC 8 ms
6,944 KB
testcase_08 AC 9 ms
6,940 KB
testcase_09 AC 13 ms
6,940 KB
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 6 ms
6,944 KB
testcase_12 AC 5 ms
6,940 KB
testcase_13 AC 12 ms
6,944 KB
testcase_14 AC 14 ms
6,940 KB
testcase_15 AC 6 ms
6,940 KB
testcase_16 AC 4 ms
6,944 KB
testcase_17 AC 5 ms
6,944 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 16 ms
6,940 KB
testcase_20 AC 14 ms
6,940 KB
testcase_21 AC 6 ms
6,944 KB
testcase_22 AC 6 ms
6,940 KB
testcase_23 AC 7 ms
6,940 KB
testcase_24 AC 13 ms
6,944 KB
testcase_25 AC 16 ms
6,940 KB
testcase_26 AC 9 ms
6,944 KB
testcase_27 AC 9 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <limits>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &&i : v) scanf("%d", &i);
    vector<int> solved(n);
    map<string, int> m; int cur = 0;
    map<int, string> minv;
    vector<vector<int>> table(0);
    int t;
    cin >> t;
    while(t--){
        string s; char c;
        cin >> s >> c;
        if(!m.count(s)) {
            minv[cur] = s;
            m[s] = cur++;
            table.emplace_back(n+2);
            table[m[s]][n] = cur-1;
        }
        int id = c - 'A';
        table[m[s]][id] = 50*v[id]+500*v[id]/(10+2*solved[id]);
        table[m[s]][n+1] += (50*v[id]+500*v[id]/(10+2*solved[id]))*10000;
        table[m[s]][n+1] = table[m[s]][n+1]/10000*10000 + t;
        solved[id]++;
    }
    sort(table.begin(),table.end(), [](vector<int> &a, vector<int> &b){
        return a.back() > b.back();
    });
    for (int i = 0; i < cur; ++i) {
        cout << i+1 << " " << minv[table[i][n]] << " ";
        for (int j = 0; j < n; ++j) {
            cout << table[i][j] << " ";
        }
        cout << table[i][n+1]/10000 << "\n";
    }
    return 0;
}
0