結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー |
![]() |
提出日時 | 2021-03-30 14:10:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,101 bytes |
コンパイル時間 | 2,802 ms |
コンパイル使用メモリ | 193,760 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-30 12:09:07 |
合計ジャッジ時間 | 4,069 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | WA * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int N;cin>>N;vector<int> L(N);for(int i=0;i<N;i++){cin>>L[i];}int T;cin>>T;string name;int people=0;char P;map<string,int> m;map<int,string> revm;vector<int> answered(N);vector<vector<int>> ans(0,vector<int>(N+2));for(int i=0;i<T;i++){cin>>name>>P;if(!m.count(name)){m[name]=people;revm[people]=name;people++;ans.push_back(vector<int>(N+2));ans[people-1][0]=people-1;}answered[P-'A']++;ans[m[name]][P-'A'+1]=50*L[P-'A']*(1+1/(0.8+0.2*answered[P-'A']));ans[m[name]][N+1]+=50*L[P-'A']*(1+1/(0.8+0.2*answered[P-'A']));}auto fn=[&](vector<int>& a,vector<int>& b){return a[N+1]>b[N+1];};sort(ans.begin(),ans.end(),fn);for(int i=1;i<=people;i++){cout<<i<<" ";cout<<revm[ans[i-1][0]]<<" ";for(int j=1;j<N+2;j++){cout<<ans[i-1][j]<<" ";}cout<<endl;}}