結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー nanaenanae
提出日時 2017-02-10 07:49:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 1,110 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 11,028 KB
実行使用メモリ 10,836 KB
最終ジャッジ日時 2023-08-27 05:17:35
合計ジャッジ時間 2,909 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,488 KB
testcase_01 AC 18 ms
8,400 KB
testcase_02 AC 17 ms
8,548 KB
testcase_03 AC 26 ms
8,664 KB
testcase_04 AC 25 ms
8,748 KB
testcase_05 AC 38 ms
9,620 KB
testcase_06 AC 55 ms
10,836 KB
testcase_07 AC 36 ms
9,324 KB
testcase_08 AC 39 ms
9,724 KB
testcase_09 AC 50 ms
10,088 KB
testcase_10 AC 24 ms
8,712 KB
testcase_11 AC 29 ms
8,868 KB
testcase_12 AC 30 ms
9,284 KB
testcase_13 AC 46 ms
9,916 KB
testcase_14 AC 51 ms
10,184 KB
testcase_15 AC 29 ms
8,860 KB
testcase_16 AC 25 ms
8,968 KB
testcase_17 AC 27 ms
8,856 KB
testcase_18 AC 21 ms
8,600 KB
testcase_19 AC 68 ms
10,748 KB
testcase_20 AC 55 ms
10,432 KB
testcase_21 AC 29 ms
9,148 KB
testcase_22 AC 27 ms
8,908 KB
testcase_23 AC 34 ms
9,068 KB
testcase_24 AC 54 ms
9,988 KB
testcase_25 AC 65 ms
10,588 KB
testcase_26 AC 38 ms
9,248 KB
testcase_27 AC 37 ms
9,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import combinations
from math import floor
from operator import itemgetter

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    Ls = [int(i) for i in input().split()]
    rank = [0] * N
    scores = {}

    T = int(input())

    for i in range(T):
        name, p = input().split()
        p = ord(p) - ord('A')
        rank[p] += 1

        if name not in scores:
            scores[name] = [0] * (N + 1)
        
        scores[name][p] += floor(50*Ls[p] + 50*Ls[p]/(0.8+0.2*rank[p]))
        scores[name][N] = i # last submit

    # debug(scores, locals())

    output = []

    for name, score in scores.items():
        output.append([name] + score[:-1] + [sum(score[:-1])] + [score[-1]])

    # debug(output, locals())

    output.sort(key=itemgetter(N+2))
    output.sort(key=itemgetter(N+1), reverse=True)

    for i in range(len(output)):
        print(i+1, *output[i][:-1])


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