結果

問題 No.628 Tagの勢い
ユーザー akitsugu777akitsugu777
提出日時 2019-12-04 17:15:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-08-20 18:26:15
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,836 KB
testcase_01 AC 13 ms
7,716 KB
testcase_02 AC 12 ms
7,716 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 13 ms
7,784 KB
testcase_05 AC 13 ms
7,772 KB
testcase_06 AC 13 ms
7,764 KB
testcase_07 AC 13 ms
7,784 KB
testcase_08 AC 13 ms
7,820 KB
testcase_09 AC 13 ms
7,780 KB
testcase_10 AC 13 ms
7,780 KB
testcase_11 AC 12 ms
7,792 KB
testcase_12 AC 19 ms
7,820 KB
testcase_13 AC 19 ms
7,916 KB
testcase_14 AC 19 ms
7,792 KB
testcase_15 AC 19 ms
7,712 KB
testcase_16 AC 18 ms
7,780 KB
testcase_17 AC 13 ms
7,852 KB
testcase_18 AC 13 ms
7,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

D = {}
for _ in range(N):
    _ = input()
    M, S = map(int, input().split())
    Tag = input().split()
    for t in Tag:
        if not t in D:
            D[t] = S
        else:
            D[t] += S

L = []
for k, v in D.items():
    L += [[v, k]]
L = sorted(L, key = lambda X: (-X[0], X[1]))

for k, v in L[:10]:
    print(v, k)
0