結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー naimonon77naimonon77
提出日時 2016-11-18 23:12:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 1,775 bytes
コンパイル時間 2,383 ms
コンパイル使用メモリ 191,300 KB
実行使用メモリ 17,148 KB
最終ジャッジ日時 2023-08-17 12:03:12
合計ジャッジ時間 4,205 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
9,684 KB
testcase_01 AC 5 ms
9,616 KB
testcase_02 AC 5 ms
9,604 KB
testcase_03 AC 10 ms
10,168 KB
testcase_04 AC 8 ms
9,916 KB
testcase_05 AC 18 ms
10,436 KB
testcase_06 AC 44 ms
14,648 KB
testcase_07 AC 18 ms
11,220 KB
testcase_08 AC 23 ms
11,960 KB
testcase_09 AC 34 ms
12,820 KB
testcase_10 AC 9 ms
10,168 KB
testcase_11 AC 11 ms
10,308 KB
testcase_12 AC 15 ms
10,832 KB
testcase_13 AC 28 ms
12,156 KB
testcase_14 AC 35 ms
12,796 KB
testcase_15 AC 13 ms
10,648 KB
testcase_16 AC 12 ms
10,800 KB
testcase_17 AC 10 ms
10,032 KB
testcase_18 AC 6 ms
9,752 KB
testcase_19 AC 59 ms
17,148 KB
testcase_20 AC 38 ms
13,456 KB
testcase_21 AC 13 ms
10,808 KB
testcase_22 AC 10 ms
10,100 KB
testcase_23 AC 15 ms
10,724 KB
testcase_24 AC 39 ms
14,352 KB
testcase_25 AC 53 ms
16,204 KB
testcase_26 AC 22 ms
11,772 KB
testcase_27 AC 20 ms
11,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

int N;
int L[MAX];
int T;
string name[MAX];
char P[MAX];
int solve_pro_cnt[MAX];
int pro_score[100][100];
map<pair<string, int>, int> each_score;

struct Pro {
	int score, time;
	string name;
	bool operator < (const Pro& p) const {
		if (score < p.score) return true;
		if (score > p.score) return false;
		if (time < p.time) return false;
		if (time > p.time) return true;
		return false;
	}
};

int getscore(int l, int n, string name) {
	solve_pro_cnt[n]++;
	int res = 50 * l + 50 * l * 10 / (8 + 2 * solve_pro_cnt[n]);
	each_score[{name, n}] = res;
	return res;
}

int main() {
	cin >> N;
	rep(i, N) cin >> L[i];
	cin >> T;
	rep(i, T) {
		cin >> name[i] >> P[i];
		P[i] -= 'A';
	}
	map<string, pair<int, int>> m;
	rep(i, T) {
		int tmp = getscore(L[P[i]], P[i], name[i]);
		m[name[i]].first += tmp;
		m[name[i]].second = i;
	}
	vector<Pro> v;
	for (auto a : m) {
		v.push_back({ a.second.first, a.second.second ,a.first });
	}
	sort(ALL(v));
	rep(i, v.size()) {
		cout << i + 1;
		int j = v.size() - 1 - i;
		cout << " " << v[j].name;
		rep(i, N) {
			cout << " " << each_score[{v[j].name, i}];
		}
		cout << " " << v[j].score;
		cout << endl;
	}
	return 0;
}
0