結果

問題 No.628 Tagの勢い
ユーザー brthyyjpbrthyyjp
提出日時 2020-06-16 16:21:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 78,932 KB
最終ジャッジ日時 2023-09-16 10:59:37
合計ジャッジ時間 3,396 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,104 KB
testcase_01 AC 68 ms
71,272 KB
testcase_02 AC 68 ms
71,276 KB
testcase_03 AC 69 ms
71,348 KB
testcase_04 AC 67 ms
71,204 KB
testcase_05 AC 69 ms
71,296 KB
testcase_06 AC 68 ms
71,248 KB
testcase_07 AC 68 ms
71,252 KB
testcase_08 AC 68 ms
71,252 KB
testcase_09 AC 68 ms
70,992 KB
testcase_10 AC 69 ms
71,488 KB
testcase_11 AC 69 ms
71,104 KB
testcase_12 AC 106 ms
77,392 KB
testcase_13 AC 107 ms
77,964 KB
testcase_14 AC 107 ms
78,452 KB
testcase_15 AC 105 ms
77,544 KB
testcase_16 AC 118 ms
78,932 KB
testcase_17 AC 69 ms
71,128 KB
testcase_18 AC 67 ms
71,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
d = {}
for i in range(n):
    no = int(input())
    m, s = map(int, input().split())
    T = list(map(str, input().split()))
    for t in T:
        if t in d:
            d[t] += s
        else:
            d[t] = s
X = list(d.items())
X.sort(key=lambda x:(-x[1], x[0]))
if len(X) > 10:
    X = X[0:10]
for i in range(len(X)):
    print(*X[i])
0