結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー c-yanc-yan
提出日時 2020-11-18 07:23:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 882 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 11,084 KB
実行使用メモリ 10,232 KB
最終ジャッジ日時 2023-09-30 14:50:04
合計ジャッジ時間 3,029 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 28 ms
8,464 KB
testcase_04 AC 26 ms
8,736 KB
testcase_05 AC 41 ms
9,784 KB
testcase_06 AC 61 ms
10,232 KB
testcase_07 AC 40 ms
8,828 KB
testcase_08 AC 40 ms
9,044 KB
testcase_09 AC 54 ms
10,028 KB
testcase_10 AC 24 ms
8,484 KB
testcase_11 AC 30 ms
8,672 KB
testcase_12 AC 31 ms
8,956 KB
testcase_13 AC 49 ms
9,804 KB
testcase_14 AC 57 ms
10,140 KB
testcase_15 AC 31 ms
8,804 KB
testcase_16 AC 25 ms
8,564 KB
testcase_17 AC 30 ms
8,556 KB
testcase_18 AC 20 ms
8,240 KB
testcase_19 AC 76 ms
9,892 KB
testcase_20 AC 59 ms
10,020 KB
testcase_21 AC 30 ms
8,656 KB
testcase_22 AC 28 ms
8,736 KB
testcase_23 AC 38 ms
8,808 KB
testcase_24 AC 59 ms
9,464 KB
testcase_25 AC 71 ms
9,716 KB
testcase_26 AC 43 ms
9,004 KB
testcase_27 AC 42 ms
8,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int, input().split()))
T = int(input())

a = ''.join(chr(ord('A') + i) for i in range(N))

base_score = {}
acs = {}
for c in a:
    base_score[c] = L[ord(c) - ord('A')]
    acs[c] = 0

def score(c):
    acs[c] += 1
    return int(50 * base_score[c] + 50 * base_score[c] / (0.8 + 0.2 * acs[c]))

result = {}
for i in range(T):
    Name, P = input().split()
    if Name in result:
        s, _, r = result[Name]
    else:
        s = 0
        r = {}
    j = score(P)
    r[P] = j
    s += j
    result[Name] = [s, -i, r]

result = sorted(([result[k][0], result[k][1], k, result[k][2]] for k in result), reverse=True)
for i in range(len(result)):
    r = result[i]
    t = []
    t.append(i + 1)
    t.append(r[2])
    for c in a:
        if c in r[3]:
            t.append(r[3][c])
        else:
            t.append(0)
    t.append(r[0])
    print(*t)
0