結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ngtkanangtkana
提出日時 2020-04-05 17:00:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,316 bytes
コンパイル時間 2,732 ms
コンパイル使用メモリ 225,548 KB
実行使用メモリ 4,572 KB
最終ジャッジ日時 2023-09-16 06:42:34
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 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<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using lubl=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n;std::cin>>n;
    std::vector<lint>lev(n),ac(n);
    for(lint&x:lev)std::cin>>x;
    std::vector<std::string>names;
    std::vector<std::tuple<lint,std::string,std::vector<lint>>>table;
    lint q;std::cin>>q;
    while(q--){
        std::string s;std::cin>>s;
        lint i;
        if(auto f=std::find(ALL(names),s);f!=names.end()){
            i=f-names.begin();
        }else{
            i=names.size();
            table.emplace_back(0,s,std::vector<lint>(n));
            names.push_back(s);
        }
        char no;std::cin>>no;
        lint j=no-'A';
        lint score=50*lev.at(j)+50*lev.at(j)/(0.8+0.2*(++ac.at(j)));
        std::get<2>(table.at(i)).at(j)=score;
    }
    for(auto&&row:table){
        std::get<0>(row)=std::accumulate(ALL(std::get<2>(row)),0ll);
    }
    std::sort(ALL(table),std::greater<>{});
    lint i=0;
    for(auto&&row:table){
        std::cout<<++i<<" "<<std::get<1>(row);
        for(auto&&x:std::get<2>(row)){
            std::cout<<" "<<x;
        }
        std::cout<<" "<<std::get<0>(row)<<'\n';
    }
}
0