結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー AEnAEn
提出日時 2022-08-26 15:52:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 840 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 80,056 KB
最終ジャッジ日時 2024-04-21 18:13:08
合計ジャッジ時間 4,515 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

from collections import defaultdict

N = int(input())
L = list(map(int, input().split()))
T = int(input())
sub = []
n = set()
name = defaultdict(int)
id = defaultdict(int)
for i in range(T):
    NA, P = map(str, input().split())
    if NA not in n:
        name[NA] = len(n)
        id[len(n)] = NA
        n.add(NA)
    sub.append((NA, P))
ac = [0]*N
ls = [-1]*len(n)
sm = [0]*len(n)
sc = [[0]*N for _ in range(len(n))]
for i, (NA, P) in enumerate(sub):
    idx = name[NA]
    ls[idx] = i
    ac[ord(P)-65] += 1
    score = 50*L[ord(P)-65]+int(50*L[ord(P)-65]//(0.8+0.2*ac[ord(P)-65]))
    sm[idx] += score
    sc[idx][ord(P)-65] = score
res = []
for i in range(len(n)):
    res.append([i, sm[i], ls[i]])
res.sort(key = lambda x:(-x[1], x[2]))
sta = 1
for i, smm, lss in res:
    Name = id[i]
    print(sta, Name, *sc[i], smm)
    sta += 1
0