結果
| 問題 | No.628 Tagの勢い |
| コンテスト | |
| ユーザー |
r_ishida
|
| 提出日時 | 2026-01-17 08:04:42 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 655 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 82,548 KB |
| 実行使用メモリ | 66,596 KB |
| 最終ジャッジ日時 | 2026-01-17 08:04:44 |
| 合計ジャッジ時間 | 2,321 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import math
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
d = {}
for _ in range(n):
no = I()
m, s = MI()
t = LS()
for tag in t:
if tag in d:
d[tag] += -s
else:
d[tag] = -s
d_s = dict(sorted(d.items(), key=lambda x: (x[1], x[0])))
cnt = 0
for k, v in d_s.items():
cnt += 1
print(k, -v)
if cnt >= 10:
break
r_ishida