
排序
排序
DNMTOOBA
这个作者很懒,什么都没留下…
展开
-
1019 逆序数
1019 逆序数 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。 如2 4 3 1中,2 1,4 3,4 1,3 1是逆序,逆序数是4。给出一个整数序列,求该序列的逆序数。Input 第1行:N,N为序列的长度原创 2017-07-19 13:42:16 · 421 阅读 · 0 评论 -
稳定排序 HDU - 1872
大家都知道,快速排序是不稳定的排序方法。 如果对于数组中出现的任意a[i],aj,其中a[i]==a[j],在进行排序以后a[i]一定出现在a[j]之前,则认为该排序是稳定的。 某高校招生办得到一份成绩列表,上面记录了考生名字和考生成绩。并且对其使用了某排序算法按成绩进行递减排序。现在请你判断一下该排序算法是否正确,如果正确的话,则判断该排序算法是否为稳定的。 Input 本题目包含多组输原创 2017-07-23 15:25:42 · 405 阅读 · 0 评论 -
What Is Your Grade? HDU - 1084
“Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the rules which are used原创 2017-07-23 20:25:02 · 809 阅读 · 0 评论 -
Milk HDU - 1070
Ignatius drinks milk everyday, now he is in the supermarket and he wants to choose a bottle of milk. There are many kinds of milk in the supermarket, so Ignatius wants to know which kind of milk is the原创 2017-07-23 21:21:56 · 445 阅读 · 0 评论 -
全排列【51nod】【全排列】
1384 全排列基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出一个字符串S(可能有重复的字符),按照字典序从小到大,输出S包括的字符组成的所有排列。例如:S = "1312",输出为:11231132121312311312132121132131原创 2017-12-06 19:25:16 · 396 阅读 · 0 评论