結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー tktk_snsntktk_snsn
提出日時 2021-02-24 23:13:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 737 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 11,908 KB
最終ジャッジ日時 2023-10-25 04:32:14
合計ジャッジ時間 3,721 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,096 KB
testcase_01 AC 29 ms
10,096 KB
testcase_02 AC 29 ms
10,152 KB
testcase_03 AC 37 ms
10,852 KB
testcase_04 AC 36 ms
10,768 KB
testcase_05 AC 52 ms
11,464 KB
testcase_06 AC 71 ms
11,648 KB
testcase_07 AC 47 ms
11,252 KB
testcase_08 AC 52 ms
11,144 KB
testcase_09 AC 70 ms
11,612 KB
testcase_10 AC 36 ms
10,484 KB
testcase_11 AC 38 ms
10,984 KB
testcase_12 AC 42 ms
10,812 KB
testcase_13 AC 61 ms
11,480 KB
testcase_14 AC 69 ms
11,692 KB
testcase_15 AC 40 ms
10,984 KB
testcase_16 AC 38 ms
10,604 KB
testcase_17 AC 39 ms
11,016 KB
testcase_18 AC 33 ms
10,372 KB
testcase_19 AC 84 ms
11,908 KB
testcase_20 AC 71 ms
11,760 KB
testcase_21 AC 40 ms
10,692 KB
testcase_22 AC 38 ms
10,908 KB
testcase_23 AC 44 ms
11,288 KB
testcase_24 AC 65 ms
11,472 KB
testcase_25 AC 78 ms
11,852 KB
testcase_26 AC 50 ms
11,300 KB
testcase_27 AC 49 ms
11,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

F = lambda N, K: 50 * N + (250 * N) // (K + 4)
atoi = lambda a: ord(a) - ord("A")

N = int(input())
L = list(map(int, input().split()))
T = int(input())
name, P = zip(*[input().rstrip().split() for _ in range(T)])
rank = [0] * N

score = {x: [0] * (N + 1) for x in set(name)}
for time, (x, p) in enumerate(zip(name, P)):
    i = atoi(p)
    rank[i] += 1
    score[x][i] += F(L[i], rank[i])
    score[x][N] = time

score = list(score.items())
score.sort(key=lambda x: (sum(x[1][:-1]), -x[1][-1]), reverse=True)

for i, (name, point) in enumerate(score, 1):
    point.pop()
    print(i, end=" ")
    print(name, end=" ")
    print(*point, end=" ")
    print(sum(point))
0