結果
| 問題 | 
                            No.447 ゆきこーだーの雨と雪 (2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             compass19
                         | 
                    
| 提出日時 | 2016-11-19 17:08:10 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 990 bytes | 
| コンパイル時間 | 93 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 15,104 KB | 
| 最終ジャッジ日時 | 2024-11-26 22:03:35 | 
| 合計ジャッジ時間 | 2,972 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | WA * 25 | 
ソースコード
from collections import defaultdict
i=input
p_num = int(i())
l = list(map(int, i().split()))
t_num = int(i())
t_list = []
name_dict = {}
alpa_list = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
			 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
ster = {alpa: l[j] for j, alpa in enumerate(alpa_list[:p_num])}
ac_list = {alpa: 1 for alpa in alpa_list[:p_num]}
data_dic = {}
name_set = set()
for j in range(t_num):
	name, p = i().split()
	t_list.append((name, p))
	name_dict[name] = j
	if name not in name_set:
		data_dic[name] = defaultdict(int)
		name_set.add(name)
	score = 50*ster[p] + int(50*ster[p] / (0.8 + 0.2*ac_list[p]))
	data_dic[name][p] = score
	data_dic[name]['_sum'] += score
	ac_list[p] += 1
ranking = sorted(data_dic.keys(), key=lambda x: (-data_dic[x]['_sum'], name_dict[x]))
for i, name in enumerate(ranking):
	print(i+1, name, end=' ')
	for p in alpa_list[:p_num]:
		print(data_dic[name][p], end=' ')
	print(data_dic[name]['_sum'])
            
            
            
        
            
compass19