結果
問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
ユーザー |
![]() |
提出日時 | 2021-03-30 16:19:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,312 bytes |
コンパイル時間 | 2,239 ms |
コンパイル使用メモリ | 197,800 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-30 14:56:18 |
合計ジャッジ時間 | 3,803 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 24 |
ソースコード
#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; double temp; string name; int people=0; char P; map<string,int> m,last; 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; } last[name]=i; answered[P-'A']++; temp=50.0*L[P-'A']; temp*=(1.0+1.0/(0.8+0.2*answered[P-'A'])); ans[m[name]][P-'A'+1]=floor(temp); ans[m[name]][N+1]+=floor(temp); } auto fn=[&](vector<int>& a,vector<int>& b){ if(a[N+1]==b[N+1]){ return last[revm[a[0]]]<last[revm[b[0]]]; } 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]; if(j!=N+1){ cout<<" "; } } cout<<endl; } }