結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー nksk38nksk38
提出日時 2017-07-01 12:33:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,499 bytes
コンパイル時間 1,355 ms
コンパイル使用メモリ 99,348 KB
実行使用メモリ 66,644 KB
最終ジャッジ日時 2024-04-15 09:55:55
合計ジャッジ時間 5,794 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
66,056 KB
testcase_01 WA -
testcase_02 AC 122 ms
66,176 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<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

#define mod 1000000007;

using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pr;
#define N_MAX 27

int N,T;
int L[N_MAX];
map<char, int> m,proble_id;
map<char, int> lev;
map<string, int> id;

 struct data_t{
	string name;
	int score[4001] = {0};
	ll total_score = 0;

	bool operator<(const data_t& right)const {
		return total_score  > right.total_score;
	}
};

 int main()
 {

	 cin >> N;
	 vector<data_t> player(4001);

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

	for (int i = 0; i < N; i++) {
		proble_id['A' + i] = i + 1;
		lev['A' + i] = L[i];
	}
	
	cin >> T;
	int idd = 1;
	for (int i = 0; i < T; i++) {
		string str;
		char p;
		cin >> str >> p; 
		if (id[str] == 0) {
			id[str] = idd++;
			player[idd - 1].name = str;
		}
		m[p]++;
		player[id[str]].score[proble_id[p]] = (int)(50 * lev[p] +50*lev[p] / (0.8 + 0.2*m[p]));	
	}

	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= N; j++) {
			player[i].total_score += player[i].score[j];
		}
	}
	sort(player.begin(),player.end());
	int rank = 1;
	for (int i = 0; i < N; i++) {
		if (player[i].name.size() == 0)continue;
		cout << rank++ << " "<< player[i].name << " ";
		for (int j = 1; j <= N; j++) {
			printf("%d",player[i].score[j]);
			cout << " ";
		}
		cout << player[i].total_score << endl;
	}
		
	return 0;
}
0