結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー maesora
提出日時 2016-12-02 21:58:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 779 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-11-27 17:43:07
合計ジャッジ時間 2,235 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import math

N = int(input())
pLevels = tuple(map(int, input().split()))
T = int(input())
pAccepted = [0] * N
contestants = {}

for i in range(T):
    s = input().strip().split()
    name = s[0]
    p = ord(s[1]) - ord("A")
    if name not in contestants:
        contestants[name] = [0] * (N + 1)
    pl = pLevels[p]
    score = 50 * pl + 50 * pl / (1 + 0.2 * pAccepted[p])
    contestants[name][p] = math.floor(score)
    pAccepted[p] += 1
    contestants[name][N] = i

i = 1
for name, scores in sorted(contestants.items(),
                           key=lambda x: (-sum(x[1][:-1]), x[1][-1])):
    print("{} {name} {scores} {sum}".format(
        i, name=name,
        scores=" ".join([str(s) for s in scores[:-1]]),
        sum=sum(scores[:-1])))
    i += 1

0