結果

問題 No.628 Tagの勢い
ユーザー nebukuro09nebukuro09
提出日時 2018-01-05 21:27:43
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 1,710 ms
コンパイル使用メモリ 76,544 KB
実行使用メモリ 79,416 KB
最終ジャッジ日時 2024-04-16 19:56:53
合計ジャッジ時間 3,962 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
75,648 KB
testcase_01 AC 70 ms
75,392 KB
testcase_02 AC 72 ms
75,776 KB
testcase_03 AC 69 ms
75,392 KB
testcase_04 AC 68 ms
75,392 KB
testcase_05 AC 70 ms
75,776 KB
testcase_06 AC 67 ms
75,392 KB
testcase_07 AC 72 ms
75,136 KB
testcase_08 AC 71 ms
75,648 KB
testcase_09 AC 71 ms
75,180 KB
testcase_10 AC 71 ms
75,424 KB
testcase_11 AC 73 ms
75,452 KB
testcase_12 AC 151 ms
79,376 KB
testcase_13 AC 101 ms
79,140 KB
testcase_14 AC 99 ms
79,360 KB
testcase_15 AC 102 ms
79,232 KB
testcase_16 AC 101 ms
79,416 KB
testcase_17 AC 68 ms
75,776 KB
testcase_18 AC 69 ms
75,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
D = {}
for i in xrange(N):
    raw_input()
    M, S = map(int, raw_input().split())
    SS = raw_input().split()
    for s in SS:
        if s in D:
            D[s] += S
        else:
            D[s] = S

cnt = 0
for k, v in sorted(D.items(), key=lambda x: (-x[1], x[0])):
    print k, v
    cnt += 1
    if cnt >= 10:
        break
0