結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ntuda
提出日時 2025-02-26 21:36:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 3,727 ms
コンパイル使用メモリ 82,032 KB
実行使用メモリ 80,132 KB
最終ジャッジ日時 2025-02-26 21:36:12
合計ジャッジ時間 5,387 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

score = defaultdict(list)
N = int(input())
L = list(map(int, input().split()))
answered = [1] * N

for i in range(int(input())):
    name, p = input().split()
    pn = ord(p) - ord("A")
    if name not in score:
        score[name] = [0] * (N + 1)
    score[name][pn] = 50 * L[pn] + int(50 * L[pn] / (0.8 + 0.2 * answered[pn]))
    score[name][-1] = i
    answered[pn] += 1

ans = []
for k, v in score.items():
    ans.append([k] + v[:-1] + [sum(v[:-1])] + [v[-1]])
ans.sort(key=lambda x: (-x[-2], x[-1]))
for i, a in enumerate(ans, start=1):
    print(i, *a[:-1])
0