結果
| 問題 |
No.449 ゆきこーだーの雨と雪 (4)
|
| ユーザー |
|
| 提出日時 | 2016-11-19 00:00:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,132 bytes |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 19,104 KB |
| 最終ジャッジ日時 | 2024-09-22 10:14:45 |
| 合計ジャッジ時間 | 7,810 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 -- * 33 |
ソースコード
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