結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー Akijin_007Akijin_007
提出日時 2023-08-03 18:29:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 735 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 79,632 KB
最終ジャッジ日時 2024-04-21 16:38:44
合計ジャッジ時間 4,179 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 38 ms
51,940 KB
testcase_02 AC 40 ms
52,480 KB
testcase_03 AC 73 ms
73,344 KB
testcase_04 AC 74 ms
73,344 KB
testcase_05 AC 123 ms
78,848 KB
testcase_06 AC 123 ms
79,104 KB
testcase_07 AC 103 ms
77,568 KB
testcase_08 AC 117 ms
78,208 KB
testcase_09 AC 116 ms
79,232 KB
testcase_10 AC 73 ms
72,576 KB
testcase_11 AC 84 ms
76,672 KB
testcase_12 AC 105 ms
77,264 KB
testcase_13 AC 118 ms
79,176 KB
testcase_14 AC 121 ms
79,232 KB
testcase_15 AC 94 ms
77,312 KB
testcase_16 AC 71 ms
73,216 KB
testcase_17 AC 75 ms
74,752 KB
testcase_18 AC 56 ms
65,152 KB
testcase_19 AC 116 ms
79,632 KB
testcase_20 AC 122 ms
78,976 KB
testcase_21 AC 92 ms
76,868 KB
testcase_22 AC 92 ms
77,568 KB
testcase_23 AC 90 ms
77,340 KB
testcase_24 AC 120 ms
78,592 KB
testcase_25 AC 125 ms
79,260 KB
testcase_26 AC 107 ms
77,692 KB
testcase_27 AC 96 ms
77,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
L = list(map(int, input().split()))
T = int(input())
p = [0] * T
for i in range(T):
    p[i] = input().split()

d = dict()
lt = dict()
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a = [1] * N

def score(t):
    return (50 + 50 / (0.8 + 0.2 * a[t])) * L[t]

for i in range(T):
    name, P = p[i]
    t = s.index(P)

    if name not in d:
        d[name] = [0] * N
        lt[name] = i
    d[name][t] += int(score(t))
    lt[name] = i
    a[t] += 1

u = []
for k, v in d.items():
    u.append((k, sum(v), lt[k]))

u = sorted(u, key=lambda x: (-x[1], x[2]))

for i in range(len(u)):
    print(i+1, u[i][0], " ".join([str(x) for x in d[u[i][0]]]), u[i][1])


0