結果

問題 No.628 Tagの勢い
ユーザー matriematrie
提出日時 2020-12-10 22:52:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 482 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,988 KB
実行使用メモリ 42,660 KB
最終ジャッジ日時 2023-10-20 00:58:02
合計ジャッジ時間 11,197 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 447 ms
42,660 KB
testcase_01 AC 449 ms
42,660 KB
testcase_02 AC 445 ms
42,660 KB
testcase_03 AC 447 ms
42,660 KB
testcase_04 AC 447 ms
42,660 KB
testcase_05 AC 448 ms
42,660 KB
testcase_06 AC 448 ms
42,660 KB
testcase_07 AC 445 ms
42,660 KB
testcase_08 AC 452 ms
42,660 KB
testcase_09 AC 450 ms
42,660 KB
testcase_10 AC 452 ms
42,660 KB
testcase_11 AC 448 ms
42,660 KB
testcase_12 AC 478 ms
42,660 KB
testcase_13 AC 482 ms
42,660 KB
testcase_14 AC 476 ms
42,660 KB
testcase_15 AC 481 ms
42,660 KB
testcase_16 AC 470 ms
42,660 KB
testcase_17 AC 452 ms
42,660 KB
testcase_18 AC 453 ms
42,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n=int(input())
l=[];p=[]
for i in range(n):
	id=int(input())
	m,s=map(int, input().split())
	for x in input().split():
		if x in l: p[l.index(x)]+=s
		else: l.append(x);p.append(s)

l=[l[i] for i in np.argsort(p)[::-1]]
p=sorted(p)[::-1]

for i in range(len(l)):
	d=1
	for j in range(1,len(l)-i):
		if p[i]==p[i+j]: d+=1
	if d>1: l[i:i+d]=sorted(l[i:i+d])

for i in range(min(10,len(l))): 
	print(l[i],p[i])
0