結果
| 問題 | No.628 Tagの勢い |
| コンテスト | |
| ユーザー |
koheijkt
|
| 提出日時 | 2025-03-22 11:50:54 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 94 ms / 2,000 ms |
| コード長 | 414 bytes |
| 記録 | |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 95,976 KB |
| 実行使用メモリ | 85,104 KB |
| 最終ジャッジ日時 | 2026-07-07 19:59:15 |
| 合計ジャッジ時間 | 3,178 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
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])
koheijkt