結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー femto
提出日時 2016-11-18 22:50:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,069 bytes
コンパイル時間 2,368 ms
コンパイル使用メモリ 192,464 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-26 07:32:35
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

struct S {
	string name;
	vector<int> score;
	int sum;
	int last;

	bool operator < (const S& s) const {
		if(this->sum != s.sum) return this->sum > s.sum;
		return this->last < s.last;
	}
};

int L[26];
int R[26];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N, T;
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> L[i];
	}
	cin >> T;

	map<string, S> m;
	for(int t = 0; t < T; t++) {
		string name;
		char p;
		cin >> name >> p;
		p -= 'A';
		if(!m.count(name)) {
			m[name].name = name;
			m[name].score = vector<int>(N);
			m[name].sum = 0;
			m[name].last = t;
		}
		R[p]++;
		int score = 50 * L[p] + (int)floor(50 * L[p] / (0.8 + 0.2 * R[p]));
		m[name].score[p] = score;
		m[name].sum += score;
		m[name].last = t;
	}

	vector<S> v;
	for(auto a : m) {
		v.push_back(a.second);
	}
	sort(v.begin(), v.end());

	for(int i = 0; i < v.size(); i++) {
		cout << i + 1 << " " << v[i].name;
		for(auto s : v[i].score) {
			cout << " " << s;
		}
		cout << " " << v[i].sum << endl;
	}
}
0