結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー ヒッキープログラミングするスレ GitHub ガチヒッキープログラミングするスレ GitHub ガチ
提出日時 2016-11-18 23:40:14
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 1,331 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,048 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2023-08-17 12:14:52
合計ジャッジ時間 2,493 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,296 KB
testcase_01 AC 15 ms
8,516 KB
testcase_02 AC 15 ms
8,424 KB
testcase_03 AC 31 ms
8,784 KB
testcase_04 AC 29 ms
8,624 KB
testcase_05 AC 45 ms
9,788 KB
testcase_06 AC 70 ms
10,112 KB
testcase_07 AC 45 ms
8,948 KB
testcase_08 AC 45 ms
9,312 KB
testcase_09 AC 65 ms
9,952 KB
testcase_10 AC 24 ms
8,632 KB
testcase_11 AC 34 ms
8,544 KB
testcase_12 AC 34 ms
9,004 KB
testcase_13 AC 54 ms
9,768 KB
testcase_14 AC 64 ms
9,928 KB
testcase_15 AC 35 ms
8,660 KB
testcase_16 AC 27 ms
8,632 KB
testcase_17 AC 33 ms
8,744 KB
testcase_18 AC 21 ms
8,532 KB
testcase_19 AC 84 ms
9,756 KB
testcase_20 AC 68 ms
9,956 KB
testcase_21 AC 33 ms
8,808 KB
testcase_22 AC 31 ms
8,540 KB
testcase_23 AC 42 ms
8,932 KB
testcase_24 AC 67 ms
9,452 KB
testcase_25 AC 81 ms
9,728 KB
testcase_26 AC 49 ms
8,800 KB
testcase_27 AC 47 ms
8,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calcscore(lv, tm):
    from math import floor
    return int(floor(50 * lv + 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 - 1)

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