結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ctyl_0ctyl_0
提出日時 2016-11-18 23:06:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 2,145 bytes
コンパイル時間 1,703 ms
コンパイル使用メモリ 130,000 KB
実行使用メモリ 4,960 KB
最終ジャッジ日時 2023-08-17 11:36:29
合計ジャッジ時間 3,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 4 ms
4,380 KB
testcase_05 AC 14 ms
4,512 KB
testcase_06 AC 17 ms
4,800 KB
testcase_07 AC 9 ms
4,380 KB
testcase_08 AC 11 ms
4,380 KB
testcase_09 AC 18 ms
4,492 KB
testcase_10 AC 4 ms
4,376 KB
testcase_11 AC 6 ms
4,380 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 15 ms
4,608 KB
testcase_14 AC 19 ms
4,600 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 5 ms
4,376 KB
testcase_17 AC 5 ms
4,380 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 20 ms
4,960 KB
testcase_20 AC 20 ms
4,844 KB
testcase_21 AC 6 ms
4,376 KB
testcase_22 AC 6 ms
4,376 KB
testcase_23 AC 7 ms
4,380 KB
testcase_24 AC 14 ms
4,380 KB
testcase_25 AC 19 ms
4,384 KB
testcase_26 AC 9 ms
4,376 KB
testcase_27 AC 8 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 5000
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
//    cout << endl;
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N;
    cin >> N;
    vector<int> L(N);
    vector<int> P(N, 1);
    rep(i, N) cin >> L[i];
    int T;
    cin >> T;
    map<string, vector<int>> M;
    vector<int> V(N);
    vector<pair<string, int>> A(T);
    rep(i, T){
        string s;
        char c;
        cin >> s >> c;
        M[s] = V;
        A[i] = mp(s, c - 'A');
    }
    
    map<string, int> I;
    map<int, string> S;
    int cnt = 0;
    for(auto m : M){
        I[m.first] = cnt;
        S[cnt] = m.first;
        cnt++;
    }
    
    // 点数、回答タイミング、id(I)
    vector<pair<pair<int, int>, int>> R;
    for(auto i : I){
        R.pb(mp(mp(0, inf), i.second));
    }
    
    rep(i, T){
        string s = A[i].first;
        int n = A[i].second;
        M[s][n] = 50 * L[n] + (50 * L[n]) / (0.8 + 0.2 * P[n]);
        P[n]++;
        R[I[s]].first = mp(R[I[s]].first.first + M[s][n], inf - i);
    }
    
    sort(all(R));
    reverse(all(R));
    
    rep(i, R.size()){
        cout << i + 1 << " " << S[R[i].second] << " ";
        voutput(M[S[R[i].second]]);
        cout << " " << R[i].first.first << endl;
    }
    
    
    
    
    return 0;
}
0