結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ヒッキープログラミングするスレ GitHub ガチヒッキープログラミングするスレ GitHub ガチ
提出日時 2016-11-18 23:35:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,327 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-05-04 18:54:32
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,880 KB
testcase_01 AC 25 ms
11,008 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def calcscore(lv, tm):
    from math import floor
    return int(50 * lv + floor(50.0 * lv / (0.8 + 0.2 * tm)))

n = int(input())
level = {}
acninzu = {}
for i, lv in enumerate(map(int, input().split())):
    problem = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[i:i+1]
    level[problem] = lv
    acninzu[problem] = 0

kakujinscore = {}

t = int(input())
for i in range(t):
    name, problem = input().split()
    acninzu[problem] += 1
    thisscore = calcscore(level[problem], acninzu[problem])
    if name in kakujinscore:
        scores, _ = kakujinscore[name]
        scores[problem] = thisscore
        kakujinscore[name] = scores, i
    else:
        scores = {}
        scores[problem] = thisscore
        kakujinscore[name] = scores, i

def sortfunc(name):
    scores, time = kakujinscore[name]
    totalscore = sum(scores.values())
    return totalscore * t + (t - time)

ranking = sorted(kakujinscore, key=sortfunc, reverse=True)

for i, name in enumerate(ranking):
    scores, _ = kakujinscore[name]
    scorelist = []
    for j, problem in enumerate('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
        if j >= n:
            break
        if problem in scores:
            scorelist.append(scores[problem])
        else:
            scorelist.append(0)   
    totalscore = sum(scores.values())
    print(i + 1, name, *scorelist, totalscore)

0