結果

問題 No.449 ゆきこーだーの雨と雪 (4)
ユーザー ヒッキープログラミングするスレ GitHub ガチヒッキープログラミングするスレ GitHub ガチ
提出日時 2016-11-19 00:00:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,132 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,020 KB
実行使用メモリ 21,944 KB
最終ジャッジ日時 2023-10-23 14:58:59
合計ジャッジ時間 8,233 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
21,944 KB
testcase_01 AC 30 ms
10,276 KB
testcase_02 AC 30 ms
10,276 KB
testcase_03 AC 60 ms
10,368 KB
testcase_04 AC 53 ms
10,364 KB
testcase_05 AC 60 ms
10,368 KB
testcase_06 AC 51 ms
10,364 KB
testcase_07 AC 57 ms
10,364 KB
testcase_08 AC 51 ms
10,364 KB
testcase_09 AC 57 ms
10,364 KB
testcase_10 AC 47 ms
10,364 KB
testcase_11 AC 55 ms
10,364 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

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())

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

def query(qname):
    ranking = sorted(kakujinscore, key=sortfunc, reverse=True)
    for i, name in enumerate(ranking):
        if name == qname:
            return i + 1
    return 0
        
for i in range(t):
    name, problem = input().split()
    if problem == '?':
        print(query(name))
        continue
    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

0