結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー AEnAEn
提出日時 2022-08-26 15:56:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 831 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 79,872 KB
最終ジャッジ日時 2024-04-21 18:16:32
合計ジャッジ時間 3,947 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,888 KB
testcase_01 AC 41 ms
53,632 KB
testcase_02 AC 41 ms
53,632 KB
testcase_03 AC 88 ms
76,928 KB
testcase_04 AC 87 ms
77,184 KB
testcase_05 AC 117 ms
79,232 KB
testcase_06 AC 123 ms
79,232 KB
testcase_07 AC 103 ms
77,824 KB
testcase_08 AC 114 ms
77,952 KB
testcase_09 AC 120 ms
79,232 KB
testcase_10 AC 87 ms
76,672 KB
testcase_11 AC 93 ms
77,184 KB
testcase_12 AC 117 ms
78,024 KB
testcase_13 AC 115 ms
79,232 KB
testcase_14 AC 120 ms
79,232 KB
testcase_15 AC 92 ms
77,440 KB
testcase_16 AC 71 ms
73,472 KB
testcase_17 AC 92 ms
77,568 KB
testcase_18 AC 66 ms
69,888 KB
testcase_19 AC 123 ms
79,744 KB
testcase_20 AC 125 ms
79,872 KB
testcase_21 AC 95 ms
77,568 KB
testcase_22 AC 93 ms
77,312 KB
testcase_23 AC 95 ms
77,440 KB
testcase_24 AC 117 ms
79,232 KB
testcase_25 AC 122 ms
79,232 KB
testcase_26 AC 100 ms
77,848 KB
testcase_27 AC 98 ms
77,696 KB
権限があれば一括ダウンロードができます

ソースコード

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]*(9+ac[ord(P)-65])//(4+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