結果

問題 No.628 Tagの勢い
ユーザー 夕叢霧香(ゆうむらきりか)夕叢霧香(ゆうむらきりか)
提出日時 2018-01-05 22:52:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-04-16 20:01:13
合計ジャッジ時間 1,830 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 37 ms
51,712 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 68 ms
74,752 KB
testcase_13 WA -
testcase_14 AC 71 ms
74,624 KB
testcase_15 WA -
testcase_16 AC 86 ms
77,312 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
hm={}
for _ in range(n):
    input()
    m,s=map(int,input().split())
    tags=input().split()
    for tag in tags:
        if tag not in hm:
            hm[tag]=0
        hm[tag]+=s
l=[]
for k in hm:
    l.append((hm[k],k))
l.sort()
l.reverse()
for i in range(min(10,len(l))):
    print(l[i][1]+' '+str(l[i][0]))
0