题解 | #明明的随机数#

明明的随机数

http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0

import sys

stack = []
for x in sys.stdin:
    if x.strip():
        stack.append(int(x.strip()))
stack.reverse()
        
while stack:
    li = set()
    num = stack.pop()
    for i in range(num):
        li.add(stack.pop())
    li = sorted(li)
    for x in li:
        print(x)
全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务