結果

問題 No.628 Tagの勢い
ユーザー takakin
提出日時 2020-05-10 20:23:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-08 05:54:57
合計ジャッジ時間 1,412 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
import collections
D=collections.defaultdict(int)
for _ in range(n):
  ni=int(input())
  m,s=map(int,input().split())
  T=[str(i) for i in input().split()]
  for t in T:
    D[t]+=s
Ans=sorted([(t,D[t]) for t in D.keys()],reverse=True,key=lambda x:x[1])
if len(Ans)>10:
  Ans=Ans[:10]
for a in Ans:
  print(*a)
0