結果
問題 | No.628 Tagの勢い |
ユーザー |
![]() |
提出日時 | 2024-06-06 05:34:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-23 17:24:18 |
合計ジャッジ時間 | 1,523 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
from operator import itemgetterN=int(input())D=dict()for i in range(N):x=int(input())x,score=map(int,input().split())L=input().split()for l in L:if l in D:D[l]+=scoreelse:D[l]=scoreANS=[]for d in D:ANS.append((d,D[d]))ANS.sort(key=itemgetter(0))ANS.sort(key=itemgetter(1),reverse=True)for a,x in ANS[:10]:print(a,x)