結果

問題 No.628 Tagの勢い
ユーザー gorugo30gorugo30
提出日時 2021-02-24 11:09:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 76,860 KB
最終ジャッジ日時 2023-10-24 18:25:57
合計ジャッジ時間 2,173 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,344 KB
testcase_01 AC 36 ms
53,344 KB
testcase_02 AC 37 ms
53,344 KB
testcase_03 AC 38 ms
53,344 KB
testcase_04 AC 37 ms
53,344 KB
testcase_05 AC 37 ms
53,344 KB
testcase_06 AC 37 ms
53,344 KB
testcase_07 AC 37 ms
53,344 KB
testcase_08 AC 39 ms
53,348 KB
testcase_09 AC 36 ms
53,352 KB
testcase_10 AC 39 ms
53,352 KB
testcase_11 AC 38 ms
53,352 KB
testcase_12 AC 77 ms
74,700 KB
testcase_13 AC 72 ms
74,700 KB
testcase_14 AC 71 ms
74,672 KB
testcase_15 AC 71 ms
74,728 KB
testcase_16 AC 88 ms
76,860 KB
testcase_17 AC 36 ms
53,356 KB
testcase_18 AC 37 ms
53,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0