結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー roaris
提出日時 2019-08-20 11:51:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 652 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 79,052 KB
最終ジャッジ日時 2024-10-06 11:52:06
合計ジャッジ時間 3,913 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor

N = int(input())
L = list(map(int, input().split()))
rank = [1] * N
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
trans = {alpha[i]: i for i in range(26)}
T = int(input())
point = {}
last = {}

for i in range(T):
    name_i, pi = input().split()
    n = trans[pi]
    
    if name_i not in point:
        point[name_i] = [0] * N
    
    point[name_i][n] = floor(50 * L[n] + 50 * L[n] / (0.8 + 0.2 * rank[n]))
    rank[n] += 1
    last[name_i] = i

names = list(point.keys())
names.sort(key=lambda k: (-sum(point[k]), last[k]))

for i in range(len(names)):
    name_i = names[i]
    print(i+1, name_i, *point[name_i], sum(point[name_i]))
0