結果
問題 | No.628 Tagの勢い |
ユーザー |
|
提出日時 | 2021-02-24 11:09:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 87 ms / 2,000 ms |
コード長 | 326 bytes |
コンパイル時間 | 600 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 77,372 KB |
最終ジャッジ日時 | 2024-09-24 11:24:19 |
合計ジャッジ時間 | 2,274 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
N = int(input()) dic = {} for i in range(N): no = int(input()) M, S = map(int, input().split()) tags = list(input().split()) for t in tags: dic[t] = dic.get(t, 0) + S l = [[k, v] for k, v in dic.items()] l.sort(key = lambda x: (-x[1], x[0])) for i in range(min(len(l), 10)): print(l[i][0], l[i][1])