結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| ユーザー |
|
| 提出日時 | 2020-08-16 22:18:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| コード長 | 1,022 bytes |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 12,672 KB |
| 最終ジャッジ日時 | 2024-10-11 10:43:39 |
| 合計ジャッジ時間 | 2,559 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
class ArgDefaultdict(dict):
def __init__(self, func):
self.func = func
def __getitem__(self, item):
if item not in self:
self[item] = self.func(item)
return super().__getitem__(item)
en2asc = lambda s: ord(s) - 65
N = int(input())
L = tuple(map(int, input().split()))
T = int(input())
class Contestant:
def __init__(self, name):
self.name = name
self.scores = [0] * N
self.last_ac = 0
def __str__(self):
s = ' '.join(map(str, self.scores))
return f'{self.name} {s} {sum(self.scores)}'
scoreboard = ArgDefaultdict(Contestant)
AC_count = [1] * N
for time in range(T):
name, p = input().split()
p = en2asc(p)
score = 50 * L[p] + 500 * L[p] // (8 + 2 * AC_count[p])
AC_count[p] += 1
scoreboard[name].scores[p] = score
scoreboard[name].last_ac = time
for i, res in enumerate(sorted(scoreboard.values(),
key=lambda c: (-sum(c.scores), c.last_ac)), 1):
print(i, res)