結果

問題 No.628 Tagの勢い
ユーザー nohakai3
提出日時 2022-07-31 20:50:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-21 02:35:38
合計ジャッジ時間 1,774 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
from collections import defaultdict
d=defaultdict(int)
for i in range(n):
    a=input()
    m,s=map(int,input().split())
    for t in input().split():
        d[t]+=s

l=[]
for t in d:
    l.append((-d[t],t))
l.sort()
for p,t in l[:10]:
    p=-p
    print(t,p)
0