結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー compass19compass19
提出日時 2016-11-18 22:59:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 979 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-05-04 18:11:26
合計ジャッジ時間 2,134 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,880 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 RE -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

i=input
p_num = int(i())
l = list(map(int, i().split()))
t_num = int(i())
t_list = []
name_list = {}
for j in range(t_num):
	name, p = i().split()
	t_list.append((name, p))
	name_list[name] = j

alpa_list = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
l_list = {alpa: l[i] for i, alpa in enumerate(alpa_list[:p_num])}
ac_list = {alpa: 1 for alpa in alpa_list[:p_num]}
rank_dic = {}
for name, p in t_list:
	if name not in rank_dic.keys():
		rank_dic[name] = {alpa: 0 for alpa in alpa_list[:p_num]}
	rank_dic[name][p] = 50*l_list[p] + 50*l_list[p] / (0.8 + 0.2*ac_list[p])
	ac_list[p] += 1

total_list = []
for name, val in rank_dic.items():
	total_list.append((name, sum(val.values())))
total_list = sorted(total_list, key=lambda x: (-x[1], name_list[x[0]]))
for i, (name, _sum) in enumerate(total_list):
	print('{0} {1} '.format(i+1, name), end='')
	for j in rank_dic[name].values():
		print('{} '.format(int(j)), end='')
	print('{}'.format(int(_sum)))
0