結果

問題 No.628 Tagの勢い
ユーザー 夕叢霧香(ゆうむらきりか)夕叢霧香(ゆうむらきりか)
提出日時 2018-01-05 22:53:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-04-16 20:01:37
合計ジャッジ時間 1,905 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,968 KB
testcase_01 AC 42 ms
52,096 KB
testcase_02 AC 42 ms
51,968 KB
testcase_03 AC 42 ms
51,968 KB
testcase_04 AC 41 ms
51,968 KB
testcase_05 AC 40 ms
52,096 KB
testcase_06 AC 41 ms
51,968 KB
testcase_07 AC 41 ms
51,712 KB
testcase_08 AC 42 ms
52,224 KB
testcase_09 AC 41 ms
51,712 KB
testcase_10 AC 42 ms
52,352 KB
testcase_11 AC 43 ms
52,224 KB
testcase_12 AC 86 ms
74,880 KB
testcase_13 AC 86 ms
75,008 KB
testcase_14 AC 84 ms
74,880 KB
testcase_15 AC 85 ms
74,752 KB
testcase_16 AC 104 ms
77,312 KB
testcase_17 AC 41 ms
52,224 KB
testcase_18 AC 41 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

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()
for i in range(min(10,len(l))):
    print(l[i][1]+' '+str(-l[i][0]))
0