結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー |
|
提出日時 | 2020-04-17 23:47:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 81 ms / 2,000 ms |
コード長 | 1,339 bytes |
コンパイル時間 | 341 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 13,440 KB |
最終ジャッジ日時 | 2024-10-03 16:12:07 |
合計ジャッジ時間 | 3,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
N=input()magick_number=65 #ord("A")L=list(map(int,input().split()))paticipat={}prob_solve = [1 for x in range(len(L))]prob_star = Ldef score (star,ac):# 50×★の数+50×★の数 / (0.8+ 0.2×ACの順位)return int(50 * star +50 * star /(0.8 + 0.2*ac))T=int(input())person,query=[],[]for i in range(T):p,q=input().split()person.append(p)query.append(q)for p in list(set(person)):paticipat[p]=[[0 for x in range(len(L))],0]#paticipat.append({"name":p,"score":[1 for x in range(len(L))]})#for p,q in zip(person,query):# q=ord(q)-magick_number# paticipat[p][q]=score(prob_star[q],prob_solve[q])# prob_solve[q]=prob_solve[q]+1for time in range(len(query)):p,q=person[time],ord(query[time])-magick_numberpaticipat[p][0][q]=score(prob_star[q],prob_solve[q])paticipat[p][1]=len(query)-timeprob_solve[q]=prob_solve[q]+1l_kekka=[]for k in paticipat.keys():l_kekka.append({"name":k,"sum":sum(paticipat[k][0]),"time":paticipat[k][1]})# l_kekka.append([k,kekka[k]])score_sorted = sorted(l_kekka,reverse=True, key=lambda x:(x["sum"],x["time"]))#print(score_sorted)#exit()for i in range(len(score_sorted)):print("{} {} {} {}".format(i+1,score_sorted[i]["name"]," ".join(map(str,paticipat[score_sorted[i]["name"]][0])),score_sorted[i]["sum"]))