当前位置:网站首页>HJ明明的随机数
HJ明明的随机数
2022-06-28 07:36:00 【有勇气的牛排】
描述
明明生成了NN个1到500之间的随机整数。请你删去其中重复的数字,即相同的数字只保留一个,把其余相同的数去掉,然后再把这些数从小到大排序,按照排好的顺序输出。
数据范围: 1≤n≤1000,输入的数字大小满足500≤val≤500
输入描述:
第一行先输入随机整数的个数 N 。 接下来的 N 行每行输入一个整数,代表明明生成的随机数。 具体格式可以参考下面的"示例"。
输出描述:
输出多行,表示输入数据处理后的结果
示例:
输入:3
2
2
1
输出:1
2
说明:输入解释:
第一个数字是3,也即这个小样例的N=3,说明用计算机生成了3个1到
500之间的随机整数,接下来每行一个随机数字,共3行,也即这3个随
机数字为:
2
2
1
所以样例的输出为:
1
2
牛客HJ:python3:
nums = []
N = input()
while True:
try:
nums.append(int(input()))
except:
break
list2 = list(set(nums))
list2.sort()
for i in list2:
print(i)
边栏推荐
- 2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
- Tencent continued to lay off staff in the second half of the year, and all business groups reduced by at least 10%. What do you think of this? Followers
- Dbeaver 22.1.1 release, visual database management platform
- R 语言绘制 动画气泡图
- HTTP Caching Protocol practice
- 卸载重装最新版mysql数据库亲测有效
- The practice of event driven architecture in vivo content platform
- Kubernetes cluster lossless upgrade practice
- A single node obtains the lock lock of the order number
- 阿里云服务器创建快照、回滚磁盘
猜你喜欢

Unity UI shadow component

Practice of traffic recording and playback in vivo

Rediscluster cluster mode capacity expansion node

linux下修改mysql端口号

分析 NFT 项目的 5 个指标

ACM笔记

GoLand IDE and delve debug Go programs in kubernetes cluster

Leetcode learning records

腾讯下半年继续裁员,所有事业群至少缩减 10%,对此你怎么看?关注者

在idea中,get和set方法爆红可能是没有安装Lombok插件
随机推荐
XML序列化向后兼容
ACM notes
2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
自动化测试的生命周期是什么?
A single node obtains the lock lock of the order number
What is a consistent hash? What scenarios can it be applied to?
MMR rearrangement (similarity is calculated by editing distance and repeatability)
NDK cross compilation
R language ggmap visual cluster
一个小工具可以更快的写爬虫
Yesterday, I went to a large factory for an interview and asked me to do four arithmetic operations. Fortunately, I am smart enough
Is it safe to open an account on Dongfang fortune
Uninstall and reinstall the latest version of MySQL database. The test is valid
Dbeaver 22.1.1 release, visual database management platform
什么是EC鼓风机(ec blower fan)?
云原生(待更新)
Practice and exploration of vivo live broadcast application technology
Alibaba cloud server creates snapshots and rolls back disks
Investment transaction and settlement of the fund
Mysql8.0和Mysql5.0访问jdbc连接