結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー chocorusk
提出日時 2019-12-13 18:19:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 1,207 bytes
コンパイル時間 1,597 ms
コンパイル使用メモリ 136,476 KB
実行使用メモリ 14,492 KB
最終ジャッジ日時 2024-06-27 07:07:23
合計ジャッジ時間 3,646 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n;
	cin>>n;
	int l[30];
	for(int i=0; i<n; i++) cin>>l[i];
	int T; cin>>T;
	string name[100010];
	char p[100010];
	map<string, int> s, t;
	map<pair<string, int>, int> v;
	map<P, string> mp;
	int cnt[30]={};
	for(int i=0; i<T; i++){
		cin>>name[i]>>p[i];
		cnt[p[i]-'A']++;
		v[{name[i], p[i]-'A'}]=(int)(50*l[p[i]-'A']+50*l[p[i]-'A']/(0.8+0.2*cnt[p[i]-'A']));
		s[name[i]]+=v[{name[i], p[i]-'A'}];
		t[name[i]]=i;
	}
	for(auto p:s){
		mp[{-p.second, t[p.first]}]=p.first;
	}
	int m=0;
	for(auto &p:mp){
		m++;
		cout<<m<<" "<<p.second;
		for(int i=0; i<n; i++){
			cout<<" "<<v[{p.second, i}];
		}
		cout<<" "<<-p.first.first<<endl;
	}
	return 0;
}
0