結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー femtofemto
提出日時 2016-11-18 22:43:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,096 bytes
コンパイル時間 2,338 ms
コンパイル使用メモリ 189,996 KB
実行使用メモリ 4,792 KB
最終ジャッジ日時 2023-08-17 11:14:07
合計ジャッジ時間 3,760 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,500 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<vector<int>, int> P;

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(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