結果
| 問題 |
No.628 Tagの勢い
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-01-20 17:32:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 594 bytes |
| コンパイル時間 | 424 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-02 22:44:28 |
| 合計ジャッジ時間 | 1,988 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict
from operator import itemgetter
scores = defaultdict(int)
N = int(readline())
for _ in range(N):
no = int(readline()) # 不要?
n_tags, score = map(int, readline().split())
tags = readline().split()
for tag in tags:
scores[tag] += score
result = list(scores.items())
result.sort(key = itemgetter(0))
result.sort(key = itemgetter(1), reverse=True)
for name, score in result[:10]:
print(name.decode(), score)
maspy