CCF Python题解(100分)201503-2 数字排序
2018-11-14 22:24
399 查看
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-1 图像旋转
- CCF Python题解(100分)201612-1 中间数
- CCF Python题解(100分)201609-1 最大波动
- CCF Python题解(100分)201604-1 折点计数
- CCF Python题解(100分)201412-2 Z字形扫描
- CCF Python题解(100分)201509-1 数列分段
- CCF Python题解(100分)201409-2 画图
- 【CCF CSP】 201503-2 数字排序(100分)
- CCF Python题解(100分)201403-2 窗口
- CCF Python题解(100分)201512-1 数位之和
- CCF Python题解(100分)201312-2 ISBN号码
- CCF Python题解(100分)201803-1 跳一跳
- CCF Python题解(100分)201412-1 门禁系统
- CCF Python题解(100分)201712-1 最小差值
- CCF Python题解(100分)201409-1 相邻数对
- CCF Python题解(100分)201709-1 打酱油
- CCF Python题解(100分)201403-1 相反数
- CCF Python题解(100分)201703-1 分蛋糕
- CCF Python题解(100分)201312-1 出现次数最多的数
- python ccf题解 201409-3 字符串匹配