結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー hotpepsihotpepsi
提出日時 2016-11-30 01:00:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 1,014 bytes
コンパイル時間 1,211 ms
コンパイル使用メモリ 99,556 KB
実行使用メモリ 4,464 KB
最終ジャッジ日時 2023-08-18 09:54:56
合計ジャッジ時間 2,895 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdio>

using namespace std;

int main(int argc, char *argv[]) {
	int N, T, L[32], F[32] = {};
	map<string, vector<int> > S;
	map<string, int> timestamp;
	cin >> N;
	for (int i = 0; i != N; ++i) {
		cin >> L[i];
	}
	cin >> T;
	for (int i = 0; i != T; ++i) {
		string name, p;
		cin >> name >> p;
		int pn = p[0] - 'A';
		++F[pn];
		int score = (int)(50 * L[pn] * (1 + 1 / (0.8 + 0.2 * F[pn])) + 1e-12);
		S[name].resize(N);
		S[name][pn] = score;
		timestamp[name] = i;
	}
	vector<tuple<int, int, string> > v;
	for (auto kv : S) {
		v.push_back(make_tuple(-accumulate(kv.second.begin(), kv.second.end(), 0), timestamp[kv.first], kv.first));
	}
	sort(v.begin(), v.end());
	for (int i = 0; i != v.size(); ++i) {
		string &name = get<2>(v[i]);
		cout << (i + 1) << " " << name;
		for (auto a : S[name]) {
			cout << " " << a;
		}
		cout << " " << -get<0>(v[i]);
		cout << endl;
	}
	return 0;
}
0