結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー TautConyTautCony
提出日時 2016-11-18 23:37:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,099 bytes
コンパイル時間 1,422 ms
コンパイル使用メモリ 118,712 KB
実行使用メモリ 5,272 KB
最終ジャッジ日時 2023-08-17 12:13:46
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,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 <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <map>
#include <iomanip>
#include <algorithm>
#include <array>
#include <sstream>
#include <set>
//#include<regex>

using namespace std;

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p) { return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v) { bool first = true; os << "["; for (unsigned int i = 0; i < v.size(); i++) { if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
inline std::ostream &operator<<(std::ostream &os, const std::vector<std::string>& v) { bool first = true; os << "["; for (unsigned int i = 0; i < v.size(); i++) { if (!first)os << ", "; os << "'" << v[i] << "'"; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0) { for (T2 i = beg; i < sz; ++i) cout << a[i] << " "; cout << endl; }

struct ITEM
{
    int id;
    vector<int> arr;
    int solved;
    int sum;
    double pena;
    ITEM()
    {
        id = 0;
        solved = 0;
        sum = 0;
        pena = 0;
        arr = vector<int>(32);
    }
};

int main()
{
    int N; cin >> N;
    vector<int> L(N);
    for (int i = 0; i < N; ++i)
        cin >> L[i];
    int T; cin >> T;
    vector<pair<int, int> > arr(T);
    int id = 0;
    map<string, int> s;
    vector<string> name(T);
    for (int i = 0; i < T; ++i)
    {
        string na;
        char prob;
        cin >> na >> prob;
        int currid;
        if (s.find(na) == s.end())
        {
            s[na] = id;
            name[id] = na;
            currid = id++;
        }
        else
        {
            currid = s[na];
        }
        arr[i].first = currid;
        arr[i].second = prob - 'A';
    }
    vector<ITEM> ret(T);
    map<int, int> index;
    double time = 1.01;
    for(auto item : arr)
    {
        //各問題、 50×★の数+50×★の数 / (0.8+ 0.2×ACの順位)とその合計となっております。
        int user = item.first;
        int prob = item.second;
        index[prob]++;
        int score = 50 * L[prob] + int((50 * L[prob]) / (0.8 + 0.2*index[prob]));
        ret[user].id = user;
        ret[user].arr[prob] = score;
        ret[user].solved++;
        ret[user].sum += score;
        ret[user].pena += time;
        time *= 1.01;
    }
    sort(ret.begin(), ret.end(), [&ret](ITEM &L, ITEM &R)
    {
        if (L.solved == R.solved)
        {
            if (L.sum == R.sum)
            {
                return L.pena < R.pena;
            }
            return L.sum > R.sum;
        }
        return L.solved > R.solved;
    });
    for(int i = 0; i < id; ++i)
    {
        cout << i+1 << " " << name[ret[i].id] << " ";
        for (int j = 0; j < N; ++j)
            cout << ret[i].arr[j] << " ";
        cout << ret[i].sum << "\n";
    }
    return 0;
}

0