結果
問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
ユーザー |
👑 ![]() |
提出日時 | 2021-02-10 16:40:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 129 ms / 2,000 ms |
コード長 | 746 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 80,384 KB |
最終ジャッジ日時 | 2024-07-08 03:00:35 |
合計ジャッジ時間 | 4,310 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
from collections import defaultdict from string import ascii_uppercase as X import sys def get(Star,Rank): return 50*Star*(Rank+9)//(Rank+4) input=sys.stdin.readline write=sys.stdout.write N=int(input()) L={x:s for x,s in zip(X,map(int,input().split()))} T=int(input()) Last=defaultdict(int) Score=defaultdict(dict) Sum=defaultdict(int) Solved=defaultdict(int) for t in range(T): Name,P=input()[:-1].split() Solved[P]+=1 Score[Name][P]=get(L[P],Solved[P]) Sum[Name]+=get(L[P],Solved[P]) Last[Name]=t Y=sorted(Last.keys(),key=lambda x:(-Sum[x],Last[x])) for rank,x in enumerate(Y,1): B=[rank,x] for i in range(N): B.append(Score[x].get(X[i],0)) B.append(Sum[x]) write(" ".join(map(str,B))+"\n")