結果
問題 |
No.628 Tagの勢い
|
ユーザー |
|
提出日時 | 2018-12-19 18:26:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 464 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-07 23:02:56 |
合計ジャッジ時間 | 1,726 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 13 |
ソースコード
n = int(input()) dct = dict() for i in range(n): _ = input() c, p = map(int, input().split()) inp = input().split() for j in inp: dct.setdefault(j, 0) dct[j] += p ls = [j for i,j in dct.items()] ls = list(set(ls)) ls.sort() ls.reverse() for i in ls: a = [ [k, j] for k, j in dct.items() if j == i] if len(a) == 1: print(a[0][0], a[0][1]) else: a.sort() for i in a: print(i[0],i[1])