結果
問題 | No.628 Tagの勢い |
ユーザー | Bioinfo_K |
提出日時 | 2018-01-05 21:45:11 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 536 bytes |
コンパイル時間 | 86 ms |
コンパイル使用メモリ | 10,844 KB |
実行使用メモリ | 8,656 KB |
最終ジャッジ日時 | 2023-07-29 14:02:00 |
合計ジャッジ時間 | 1,240 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 19 ms
8,528 KB |
testcase_01 | AC | 18 ms
8,616 KB |
testcase_02 | AC | 17 ms
8,472 KB |
testcase_03 | AC | 17 ms
8,476 KB |
testcase_04 | AC | 18 ms
8,492 KB |
testcase_05 | AC | 18 ms
8,524 KB |
testcase_06 | AC | 18 ms
8,616 KB |
testcase_07 | AC | 17 ms
8,480 KB |
testcase_08 | AC | 17 ms
8,484 KB |
testcase_09 | AC | 18 ms
8,564 KB |
testcase_10 | AC | 18 ms
8,604 KB |
testcase_11 | AC | 17 ms
8,656 KB |
testcase_12 | AC | 21 ms
8,544 KB |
testcase_13 | AC | 21 ms
8,560 KB |
testcase_14 | AC | 20 ms
8,488 KB |
testcase_15 | AC | 21 ms
8,548 KB |
testcase_16 | AC | 20 ms
8,548 KB |
testcase_17 | AC | 18 ms
8,612 KB |
testcase_18 | AC | 18 ms
8,620 KB |
ソースコード
import sys,collections from operator import itemgetter sys.setrecursionlimit(10**7) def Is(): return [int(x) for x in sys.stdin.readline().split()] def Ss(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def S(): return input() n = I() d = collections.defaultdict(int) for i in range(n): no = I() m,s = Is() tags = Ss() for tag in tags: d[tag] += s ans = sorted(d.items(),key=itemgetter(0)) ans = sorted(ans,key=itemgetter(1),reverse=True)[:10] for e in ans: print(e[0],e[1])