結果
問題 |
No.628 Tagの勢い
|
ユーザー |
|
提出日時 | 2024-06-12 09:47:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 625 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-12 09:47:15 |
合計ジャッジ時間 | 2,228 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
n = int(input()) dic = {} for i in range(n): no = int(input()) m, s = map(int, input().split()) tag = input().split() for j in range(m): if tag[j] not in dic: dic[tag[j]] = s else: dic[tag[j]] += s ans = sorted(dic.items(), key=lambda x: (-x[1], x[0])) cnt = 0 for k, v in ans: print(k, v) cnt += 1 if cnt == 10: break