結果

問題 No.628 Tagの勢い
コンテスト
ユーザー koheijkt
提出日時 2025-03-22 11:50:54
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 62 ms / 2,000 ms
+ 645µs
コード長 414 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 74 ms
コンパイル使用メモリ 80,160 KB
実行使用メモリ 85,100 KB
最終ジャッジ日時 2026-10-12 14:23:21
合計ジャッジ時間 2,153 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import defaultdict
N = int(input())
dd = defaultdict(int)

for _ in range(N):
    n = int(input())
    m, score = map(int, input().split())
    words = list(input().split())
    for word in words:
        dd[word] += score

ans = sorted(dd.items())
ans.sort(key=lambda x: x[0])
ans.sort(key=lambda x: x[1], reverse=True)

for i in range(10):
    if i == len(ans):
        break
    print(*ans[i])
0