結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-11-19 14:27:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 1,155 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 90,692 KB
最終ジャッジ日時 2023-08-17 21:20:52
合計ジャッジ時間 8,796 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
77,896 KB
testcase_01 AC 148 ms
77,960 KB
testcase_02 AC 141 ms
77,824 KB
testcase_03 AC 229 ms
82,740 KB
testcase_04 AC 224 ms
81,916 KB
testcase_05 AC 277 ms
84,784 KB
testcase_06 AC 304 ms
86,768 KB
testcase_07 AC 291 ms
85,572 KB
testcase_08 AC 299 ms
86,636 KB
testcase_09 AC 293 ms
86,556 KB
testcase_10 AC 221 ms
82,112 KB
testcase_11 AC 241 ms
83,132 KB
testcase_12 AC 263 ms
83,568 KB
testcase_13 AC 284 ms
85,912 KB
testcase_14 AC 296 ms
86,092 KB
testcase_15 AC 242 ms
83,324 KB
testcase_16 AC 201 ms
82,124 KB
testcase_17 AC 241 ms
82,792 KB
testcase_18 AC 196 ms
81,592 KB
testcase_19 AC 308 ms
90,692 KB
testcase_20 AC 296 ms
87,340 KB
testcase_21 AC 247 ms
83,572 KB
testcase_22 AC 238 ms
83,184 KB
testcase_23 AC 254 ms
83,628 KB
testcase_24 AC 300 ms
86,704 KB
testcase_25 AC 319 ms
90,012 KB
testcase_26 AC 260 ms
83,812 KB
testcase_27 AC 254 ms
84,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

import collections
import heapq
import itertools
import string


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


def main():
    num_probs = int(input())
    ls = dict(zip(string.ascii_uppercase, (int(l) for l in input().split())))
    num_subs = int(input())
    ac_pos = collections.defaultdict(lambda: 1)
    total_score = collections.defaultdict(int)
    each_score = collections.defaultdict(lambda: collections.defaultdict(int))
    pq = []
    for i in range(num_subs):
        name, p = input().split()
        s = sub_score(ls[p], ac_pos[p])
        each_score[name][p] = s
        total_score[name] += s
        ac_pos[p] += 1
        heapq.heappush(pq, (-total_score[name], i, name))
    processed = set()
    j = 0
    while pq:
        total, _, name = heapq.heappop(pq)
        if name not in processed:
            j += 1
            processed.add(name)
            total = -total
            g = (each_score[name][x] for x in
                 string.ascii_uppercase[:num_probs])
            print(j, name, *itertools.chain(g, (total, )))


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