結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー gigimegigime
提出日時 2016-11-18 23:41:22
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,440 bytes
コンパイル時間 1,750 ms
コンパイル使用メモリ 182,192 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 18:57:05
合計ジャッジ時間 2,713 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,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;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

int N,T;

int get_score(int n,int k)
{
	return 50.0 * n + (int) (50.0 * n / (0.8 + 0.2 * k));
}
struct score{
	vector<int> problems;
	int sum,last;
	string name;
	bool operator>(const score& other) const{
		if(this->sum != other.sum){
			return this->sum > other.sum;
		}
		return this->last < other.last;
	}
};

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

	cin >> N;
	vector<int> L(N);
	FOR(i,0,N){
		cin >> L [i];
	}
	cin >> T;
	map<string,score> mp;
	vector<int> solved(N);
	FOR(i,0,T){
		string s;
		char c;
		cin >> s >> c;
		int p_idx = c - 'A';
		if(mp.count(s) == 0){
			mp [s].problems.assign(N,0);
			mp [s].name = s;
		}
		mp [s].problems [p_idx] += get_score(L [p_idx],++solved [p_idx]);
		mp [s].sum += get_score(L [p_idx],solved [p_idx]);
		mp [s].last = i;
	}

	vector<score> standing;
	for(auto it : mp){
		standing.push_back(it.second);
	}
	sort(ALL(standing),greater<score>());

	FOR(i,0,standing.size()){
		cout << i + 1 << " " << standing [i].name << " ";
		FOR(j,0,N){
			cout << standing [i].problems [j] << " ";
		}
		cout << standing [i].sum << endl;
	}

	return 0;
}
0