結果

問題 No.628 Tagの勢い
ユーザー takakintakakin
提出日時 2020-05-10 20:26:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 8,680 KB
最終ジャッジ日時 2023-09-22 14:22:39
合計ジャッジ時間 1,419 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,460 KB
testcase_01 AC 19 ms
8,468 KB
testcase_02 AC 19 ms
8,660 KB
testcase_03 AC 19 ms
8,656 KB
testcase_04 AC 19 ms
8,512 KB
testcase_05 AC 18 ms
8,584 KB
testcase_06 AC 18 ms
8,476 KB
testcase_07 AC 19 ms
8,608 KB
testcase_08 AC 19 ms
8,540 KB
testcase_09 AC 18 ms
8,588 KB
testcase_10 AC 19 ms
8,516 KB
testcase_11 AC 18 ms
8,588 KB
testcase_12 AC 22 ms
8,596 KB
testcase_13 AC 23 ms
8,680 KB
testcase_14 AC 23 ms
8,640 KB
testcase_15 AC 22 ms
8,544 KB
testcase_16 AC 22 ms
8,640 KB
testcase_17 AC 19 ms
8,608 KB
testcase_18 AC 18 ms
8,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
import collections
D=collections.defaultdict(int)
for _ in range(n):
  ni=int(input())
  m,s=map(int,input().split())
  T=[str(i) for i in input().split()]
  for t in T:
    D[t]+=-s
Ans=sorted([(t,D[t]) for t in D.keys()],key=lambda x:(x[1],x[0]))
if len(Ans)>10:
  Ans=Ans[:10]
for a in Ans:
  x,y=a
  print(x,-y)
0