結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー fiordfiord
提出日時 2017-03-01 19:50:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 837 bytes
コンパイル時間 1,703 ms
コンパイル使用メモリ 103,880 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-03 17:05:01
合計ジャッジ時間 3,084 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 5 ms
4,380 KB
testcase_04 AC 5 ms
4,380 KB
testcase_05 AC 13 ms
4,384 KB
testcase_06 AC 18 ms
4,384 KB
testcase_07 AC 9 ms
4,384 KB
testcase_08 AC 11 ms
4,384 KB
testcase_09 AC 18 ms
4,388 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 AC 7 ms
4,384 KB
testcase_13 AC 15 ms
4,380 KB
testcase_14 AC 21 ms
4,384 KB
testcase_15 AC 6 ms
4,380 KB
testcase_16 AC 5 ms
4,384 KB
testcase_17 AC 5 ms
4,384 KB
testcase_18 AC 3 ms
4,384 KB
testcase_19 AC 24 ms
4,380 KB
testcase_20 AC 20 ms
4,384 KB
testcase_21 AC 6 ms
4,384 KB
testcase_22 AC 5 ms
4,380 KB
testcase_23 AC 7 ms
4,384 KB
testcase_24 AC 16 ms
4,380 KB
testcase_25 AC 22 ms
4,380 KB
testcase_26 AC 10 ms
4,384 KB
testcase_27 AC 9 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int n;	cin>>n;
	vector<int> l(n);
	for(int i=0;i<n;i++)	cin>>l[i];
	vector<int> cnt(n,1);
	int t;	cin>>t;
	map<string,vector<int>> mp;
	map<string,pair<int,int>> sum;
	for(int i=0;i<t;i++){
		string s,c;	cin>>s>>c;
		if(mp[s].empty())	mp[s]=vector<int>(n,0);
		int num=c[0]-'A';
		int add=50*l[num]+50*l[num]/(0.8+0.2*cnt[num]++);
		mp[s][num]=add;
		sum[s]=make_pair(sum[s].first+add,-i);
	}
	vector<pair<pair<int,int>,string>> rank;
	for(auto i:sum)	rank.push_back(make_pair(i.second,i.first));
	sort(rank.begin(),rank.end());	reverse(rank.begin(),rank.end());
	int i=1;
	for(auto out:rank){
		cout<<i++<<" "<<out.second;
		for(int i=0;i<n;i++)	cout<<" "<<mp[out.second][i];
		cout<<" "<<out.first.first<<endl;
	}
	return 0;
}
0