1104.数据排序 |
Time Limit: 1000 MS Memory Limit: 12288 KB Total Submission(s): 45 Accepted Submission(s): 15 |
Description |
ZZK和SYC不知从哪个老师那里拿到了一堆实验数据,需要排序后再交回去。
实验数据的格式为: 样本序号 观测数据 要求按照观测数据由小到大排列,当观测数据相等时按照出现顺序排列 |
Input |
实验数据,每行两个不超过100000的整数,分别为样本序号和观测数据,直到EOF
保证不超过100000行 |
Output |
排序后的实验数据
|
Sample Input |
4 2 5 4 4 3 3 4 2 9 5 6 6 10 3 5 10 4 10 8 5 4 7 6 1 4 3 10 8 7 8 7 5 4 3 4 4 4 6 5 |
Sample Output |
4 2 4 3 5 4 3 4 10 4 5 4 1 4 5 4 3 4 4 4 3 5 6 5 5 6 7 6 8 7 8 7 10 8 2 9 6 10 3 10 |
Hint |
http://www.cplusplus.com/reference/algorithm/
对结构体排序可能需要自定义比较方法或着重载运算符
stable_sort稳定排序
|
sdnuoj1104 数据排序
最新推荐文章于 2019-11-05 19:15:04 发布