题解 | #明明的随机数#
明明的随机数
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
import sys n = sys.stdin.readline() # 读取第一行的总个数 li = [] for line in sys.stdin: # 循环读取后面的随机数的值 li.append(int(line)) # 计数排序 count = [0 for _ in range(0, 501)] # 创建计数列表 for val in li: count[val] += 1 for ind, val in enumerate(count): if val > 0: print(ind)