結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-11-20 19:58:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 1,071 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 81,100 KB
最終ジャッジ日時 2024-05-05 12:01:56
合計ジャッジ時間 5,254 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,516 KB
testcase_01 AC 39 ms
54,996 KB
testcase_02 AC 39 ms
55,172 KB
testcase_03 AC 121 ms
77,320 KB
testcase_04 AC 107 ms
77,308 KB
testcase_05 AC 152 ms
80,344 KB
testcase_06 AC 153 ms
80,740 KB
testcase_07 AC 155 ms
79,572 KB
testcase_08 AC 147 ms
79,968 KB
testcase_09 AC 175 ms
80,420 KB
testcase_10 AC 113 ms
77,252 KB
testcase_11 AC 125 ms
77,456 KB
testcase_12 AC 127 ms
79,176 KB
testcase_13 AC 160 ms
80,336 KB
testcase_14 AC 167 ms
79,744 KB
testcase_15 AC 120 ms
77,436 KB
testcase_16 AC 84 ms
76,932 KB
testcase_17 AC 111 ms
77,444 KB
testcase_18 AC 72 ms
72,856 KB
testcase_19 AC 157 ms
80,964 KB
testcase_20 AC 173 ms
81,016 KB
testcase_21 AC 132 ms
78,360 KB
testcase_22 AC 120 ms
77,812 KB
testcase_23 AC 134 ms
78,692 KB
testcase_24 AC 162 ms
80,508 KB
testcase_25 AC 174 ms
81,100 KB
testcase_26 AC 143 ms
79,520 KB
testcase_27 AC 130 ms
79,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

import collections
import heapq


def sub_score(level, ac_pos):
    return 50 * level + 500 * level // (8 + 2 * ac_pos)


def alpha2int(c):
    return ord(c) - ord("A")


def main():
    n = int(input())
    ls = [int(l) for l in input().split()]
    t = int(input())
    pq = []
    ac_pos = [1 for _ in range(n)]
    total_score = collections.defaultdict(int)
    each_score = collections.defaultdict(lambda: [0 for _ in range(n)])
    for i in range(t):
        name, p = input().split()
        p_id = alpha2int(p)
        s = sub_score(ls[p_id], ac_pos[p_id])
        ac_pos[p_id] += 1
        each_score[name][p_id] += s
        total_score[name] += s
        heapq.heappush(pq, (-total_score[name], i, name))
    processed_names = set()
    j = 0
    while pq:
        total, _, name = heapq.heappop(pq)
        if name not in processed_names:
            processed_names.add(name)
            j += 1
            mes = " ".join(str(x) for x in each_score[name])
            print(j, name, mes, -total)


if __name__ == '__main__':
    main()
0