結果

問題 No.628 Tagの勢い
ユーザー osrgy01
提出日時 2021-05-17 14:48:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-06 14:17:45
合計ジャッジ時間 1,392 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
cnt={}
for _ in range(n):
    input()
    _,m=map(int,input().split())
    for i in input().split():
        if i not in cnt:
            cnt[i]=m
        else:
            cnt[i]+=m
cnt=sorted(cnt.items(),key=lambda x:(-x[1],x[0]))
for i in range(min(10,len(cnt))):
    print(cnt[i][0],cnt[i][1])
0