結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー Naoyk1212Naoyk1212
提出日時 2017-04-20 19:02:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,447 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 173,604 KB
実行使用メモリ 4,672 KB
最終ジャッジ日時 2023-09-27 03:52:25
合計ジャッジ時間 7,496 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
#define int long long

vector<pair<int, int> > difficulty;
map<string, vector<int> > score;
vector<pair<int, string> > standing;
int n;

void check(string name){
	bool ok = false;
	for(auto a : score){
		if(a.first == name) ok = true;
	}
	
	if(ok == false){
		for(int i = 0; i < n; i++){
			score[name].push_back(0);
		}
	}
}

void solve(string name, char c){
	check(name);
	int diff = c - 'A';
	int point = 50 * difficulty[diff].first + (50 * difficulty[diff].first) / (0.8 + 0.2 * difficulty[diff].second);
	difficulty[diff].second++;
	score[name].erase(score[name].begin() + diff);
	score[name].insert(score[name].begin() + diff, point);
}

signed main(){
	cin >> n;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		difficulty.push_back(make_pair(a, 1));
	}

	int t;
	cin >> t;
	for(int i = 0; i < t; i++){
		string str;
		char p;
		cin >> str >> p;
		solve(str, p);
	}

	for(auto a : score){
		string name = a.first;
		int sum = 0;
		for(int i = 0; i < a.second.size(); i++){
			sum += a.second[i];
		}
		standing.push_back(make_pair(sum, name));
	}

	sort(standing.begin(), standing.end(), greater<pair<int, string> >());

	for(int i = 0; i < standing.size(); i++){
		string name = standing[i].second;
		cout << i + 1 << " " << name;
		for(int j = 0; j < score[name].size(); j++){
			cout << " " << score[name][j];
		}
		cout << " " << standing[i].first << endl;
	}
}
0