結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー co_co_cocoa
提出日時 2016-11-18 23:11:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,341 bytes
コンパイル時間 1,285 ms
コンパイル使用メモリ 103,908 KB
実行使用メモリ 7,680 KB
最終ジャッジ日時 2024-11-26 08:30:41
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>
#include<map>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
typedef pair<int,string> P;

int main(){
    map<string,map<char,int> > m;
    
    map<char,int> dict;
    for(int i=0;i<26;i++){
        char tmp='A'+i;
        dict[tmp]=i;
    }
    int N;
    cin>>N;
    int diffi[26];
    for(int i=0;i<N;i++){
        cin>>diffi[i];
    }
    int appea[26]={};
    int K;
    cin>>K;
    for(int i=0;i<K;i++){
        string str;
        char tmp;
        cin>>str>>tmp;
        appea[dict[tmp]]++;
        //点数の計算
        double wari = 0.8+0.2*appea[dict[tmp]];
        int poi = 50*diffi[dict[tmp]] + (int)((50.0*diffi[dict[tmp]])/wari);
        m[str][tmp]=poi;
    }
    P suum[4001];
    int l=0;
    for(map<string,map<char,int> >::iterator itr=m.begin();itr!=m.end();itr++){
        int tot=0;
        for(int i=0;i<N;i++){
            char tmp='A'+i;
            tot+=((*itr).second)[tmp];
        }
        suum[l]=P(tot,(*itr).first);
        l++;
    }
    sort(suum,suum+l);
    int k=1;
    for(int i=l-1;i>=0;i--){
        cout<<k<<' '<<suum[i].second<<' ';
        for(int j=0;j<N;j++){
            char tmp='A'+j;
            cout<<m[suum[i].second][tmp]<<' ';
        }
        cout<<suum[i].first<<endl;
        k++;
    }
    
    
    return 0;
}
0