from collections import Counter, defaultdict
n = int(input())
data = list(map(int, input().split()))
info = Counter(data)
infolist = []
realdict = defaultdict(set)
for value in info.values():
for key in info.keys():
if info[key] == value:
realdict[value].add(key)
reallist = sorted(realdict.items(), key=lambda e: e[0], reverse=True)
for i in reallist:
for j in sorted(i[1]):
print(j, i[0])
CCF Python题解(100分)201503-2 数字排序
最新推荐文章于 2020-11-11 10:53:28 发布