結果
問題 |
No.628 Tagの勢い
|
ユーザー |
|
提出日時 | 2018-02-08 09:26:14 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,656 KB |
最終ジャッジ日時 | 2024-10-07 22:28:47 |
合計ジャッジ時間 | 1,554 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
from collections import defaultdict n=int(raw_input()) d=defaultdict(int) for i in xrange(n): no=int(raw_input()) m,s=map(int, raw_input().split()) tag=raw_input().split() for w in tag: d[w]+=s l=[w for w in d] l=sorted(l) l=sorted(l,key=lambda x:d[x],reverse=True) m=min(10,len(l)) for i in xrange(m): w=l[i] print w,d[w]