結果

問題 No.628 Tagの勢い
ユーザー wajima_wataruwajima_wataru
提出日時 2018-01-05 21:34:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-16 19:58:08
合計ジャッジ時間 1,515 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())
tag_score = dict()
for _ in range(N):
    no = input()
    num, score = map(int, input().split())
    tags = input().split()
    for tag in tags:
        if tag in tag_score:
            tag_score[tag] += score
        else:
            tag_score[tag] = score
for i, (t, s) in enumerate(sorted(tag_score.items(), reverse=True, key=lambda x: x[1])):
    if i >= 10:
        break
    print(str(t) + ' ' + str(s))
0