結果

問題 No.628 Tagの勢い
ユーザー dangodango
提出日時 2023-06-06 20:42:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 78,536 KB
最終ジャッジ日時 2023-08-28 10:49:04
合計ジャッジ時間 3,571 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,596 KB
testcase_01 AC 92 ms
71,580 KB
testcase_02 AC 94 ms
71,656 KB
testcase_03 AC 93 ms
71,736 KB
testcase_04 AC 93 ms
71,656 KB
testcase_05 AC 90 ms
71,648 KB
testcase_06 AC 93 ms
71,500 KB
testcase_07 AC 90 ms
71,756 KB
testcase_08 AC 92 ms
71,656 KB
testcase_09 AC 91 ms
71,712 KB
testcase_10 AC 94 ms
71,544 KB
testcase_11 AC 93 ms
71,684 KB
testcase_12 AC 125 ms
78,328 KB
testcase_13 AC 125 ms
78,336 KB
testcase_14 AC 126 ms
78,536 KB
testcase_15 AC 127 ms
78,156 KB
testcase_16 AC 139 ms
78,408 KB
testcase_17 AC 92 ms
71,548 KB
testcase_18 AC 91 ms
71,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
score = defaultdict(int)
for _ in range(int(input())):
  _ = int(input())
  _, S = map(int, input().split())
  for tag in input().split():
    score[tag] += S
scorelist = [elm for elm in score.items()]
scorelist.sort(key=lambda elm: (-elm[1], elm[0]))
for idx, (tagname, num) in enumerate(scorelist):
  if idx >= 10:
    break
  print(tagname, num)
0