nyoj322 sort 归并排序,树状数组
摘要:Sort时间限制:1000 ms | 内存限制:65535 KB难度:4描述You want to processe a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. Then how many times it need.For example, 1 2 3 5 4, we only need one operation : swap 5 and 4.输入The input consists
阅读全文
posted @
2013-08-05 14:13
细雨微光
阅读(332)
推荐(0) 编辑
ny8 一种排序 sort
摘要:一种排序时间限制:3000 ms | 内存限制:65535 KB难度:3描述现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求按照一下方式排序(默认排序规则都是从小到大);1.按照编号从小到大排序2.对于编号相等的长方形,按照长方形的长排序;3.如果编号和长都相同,按照长方形的宽排序;4.如果编号、长、宽都相同,就只保留一个长方形用于排序,删除多余的长方形;最后排好序按照指定格式显示所有的长方形;输入 第一行有一个整数 0#includeusing namespace std;struct T{ int a,b,c;}d...
阅读全文
posted @
2013-07-23 15:33
细雨微光
阅读(416)
推荐(0) 编辑