結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー めうめう🎒めうめう🎒
提出日時 2017-02-02 03:04:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 1,425 bytes
コンパイル時間 1,322 ms
コンパイル使用メモリ 104,160 KB
実行使用メモリ 10,908 KB
最終ジャッジ日時 2023-08-25 17:06:45
合計ジャッジ時間 3,451 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 6 ms
4,376 KB
testcase_04 AC 5 ms
4,376 KB
testcase_05 AC 14 ms
4,376 KB
testcase_06 AC 40 ms
8,316 KB
testcase_07 AC 16 ms
4,892 KB
testcase_08 AC 20 ms
5,664 KB
testcase_09 AC 31 ms
6,564 KB
testcase_10 AC 6 ms
4,376 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 12 ms
4,656 KB
testcase_13 AC 25 ms
5,940 KB
testcase_14 AC 32 ms
6,520 KB
testcase_15 AC 9 ms
4,380 KB
testcase_16 AC 9 ms
4,544 KB
testcase_17 AC 7 ms
4,376 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 57 ms
10,908 KB
testcase_20 AC 36 ms
7,240 KB
testcase_21 AC 10 ms
4,500 KB
testcase_22 AC 6 ms
4,376 KB
testcase_23 AC 12 ms
4,500 KB
testcase_24 AC 36 ms
8,028 KB
testcase_25 AC 51 ms
9,904 KB
testcase_26 AC 19 ms
5,552 KB
testcase_27 AC 17 ms
5,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(ll i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

int n, m, star[30] = {}, howSolved[30] = {};
map<string, pair<int, int> > mp;
map<pair<string, int>, int> score;

int main() {
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> star[i];
	}
	cin >> m;
	string name;
	char solved;
	for(int i = 0;i < m;i++){
		cin >> name >> solved;
		int num = solved - 'A';
		howSolved[num]++;
		double nowSco = 50.0 * star[num] + 50.0 * star[num] / (0.8 + 0.2 * howSolved[num]);
		// cout << ";" << nowSco << endl;
		mp[name].first += nowSco;
		mp[name].second = i;
		score[MP(name, num)] = nowSco;
	}

	vector<pair<int, pair<int, string> > > data;
	map<string, pair<int, int> >::iterator it = mp.begin();
	for(;it != mp.end();it++){
		data.push_back(MP(-it->second.first, MP(it->second.second, it->first)));
	}

	sort(data.begin(), data.end());

	for(int i = 0;i < data.size();i++){
		string nowName = data[i].second.second;
		cout << i + 1 << " " << nowName << " ";
		for(int j = 0;j < n;j++){
			cout << score[MP(nowName, j)] << " ";
		}
		cout << -data[i].first << endl;
	}
	return 0;
}
0