結果

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

ソースコード

diff #
プレゼンテーションモードにする

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 5000
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
if(p) cout << fixed << setprecision(p) << a << "\n";
else cout << a << "\n";
}
template <typename T> inline void voutput(T &v){
rep(i, v.size()){
if (i) cout << " " << v[i];
else cout << v[i];
}
// cout << endl;
}
// end of template
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
// source code
int N;
cin >> N;
vector<int> L(N);
vector<int> P(N, 1);
rep(i, N) cin >> L[i];
int T;
cin >> T;
map<string, vector<int>> M;
vector<int> V(N);
vector<pair<string, int>> A(T);
rep(i, T){
string s;
char c;
cin >> s >> c;
M[s] = V;
A[i] = mp(s, c - 'A');
}
map<string, int> I;
map<int, string> S;
int cnt = 0;
for(auto m : M){
I[m.first] = cnt;
S[cnt] = m.first;
cnt++;
}
// id(I)
vector<pair<pair<int, int>, int>> R;
for(auto i : I){
R.pb(mp(mp(0, inf), i.second));
}
rep(i, T){
string s = A[i].first;
int n = A[i].second;
M[s][n] = 50 * L[n] + (50 * L[n]) / (0.8 + 0.2 * P[n]);
P[n]++;
R[I[s]].first = mp(R[I[s]].first.first + M[s][n], inf - i);
}
sort(all(R));
reverse(all(R));
rep(i, R.size()){
cout << i + 1 << " " << S[R[i].second] << " ";
voutput(M[S[R[i].second]]);
cout << " " << R[i].first.first << endl;
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0