結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー rlangevinrlangevin
提出日時 2023-04-24 12:19:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 79,104 KB
最終ジャッジ日時 2024-04-26 02:09:07
合計ジャッジ時間 4,163 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 38 ms
52,608 KB
testcase_03 AC 83 ms
76,928 KB
testcase_04 AC 83 ms
76,544 KB
testcase_05 AC 116 ms
78,696 KB
testcase_06 AC 121 ms
78,592 KB
testcase_07 AC 102 ms
77,220 KB
testcase_08 AC 108 ms
77,668 KB
testcase_09 AC 111 ms
78,464 KB
testcase_10 AC 86 ms
76,928 KB
testcase_11 AC 93 ms
77,184 KB
testcase_12 AC 100 ms
77,312 KB
testcase_13 AC 107 ms
78,464 KB
testcase_14 AC 112 ms
78,592 KB
testcase_15 AC 90 ms
77,172 KB
testcase_16 AC 64 ms
70,784 KB
testcase_17 AC 87 ms
76,672 KB
testcase_18 AC 61 ms
67,712 KB
testcase_19 AC 116 ms
78,336 KB
testcase_20 AC 118 ms
79,104 KB
testcase_21 AC 91 ms
77,056 KB
testcase_22 AC 94 ms
77,312 KB
testcase_23 AC 95 ms
77,016 KB
testcase_24 AC 112 ms
78,080 KB
testcase_25 AC 118 ms
78,720 KB
testcase_26 AC 100 ms
77,440 KB
testcase_27 AC 105 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x, n):
    return 50 * x + (500 * x)//(8 + 2 * n)

N = int(input())
L = list(map(int, input().split()))
T = int(input())
DS, D = dict(), dict()
cnt = [1] * N
ans = []
for i in range(T):
    name, P = input().split()
    n = ord(P) - ord("A")
    if name in D:
        D[name].append([f(L[n], cnt[n]), n])
    else:
        D[name] = [[f(L[n], cnt[n]), n]]
    cnt[n] += 1
    if name in DS:
        DS[name] = [DS[name][0] + D[name][-1][0], i]
    else:
        DS[name] = [D[name][-1][0], i]

lst = []
for k, v in DS.items():
    lst.append([-v[0], v[1], k])
lst.sort()
idx = 1
for v0, v1, k in lst:
    # print("test", v0, v1, k)
    temp = [idx, k]
    temp2 = [0] * N
    for d0, d1 in D[k]:
        temp2[d1] = d0
    temp.extend(temp2)
    temp.append(-v0)
    print(*temp)
    idx += 1
0