![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
胡十八
这个作者很懒,什么都没留下…
展开
-
归并排序
归并排序 大佬链接,有图有注释,很详细https://blog.csdn.net/k_koris/article/details/80508543 #include <cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; const ...原创 2019-08-25 15:05:06 · 95 阅读 · 0 评论 -
ACM18训练赛-求排列逆序数(归并排序求逆序数)
排列的逆序数 题目描述 一个大小为n(2<=n<=1e5)排列中, 对于一个a[i]>a[j] (i<j), 那么我们称(a[i], a[j])为逆序数。 现在给你一个排列, 让你求这个排列有多少个逆序数。 输入 第一行输入n 第二行输入一个排列(1-n)。 输出 输出这个排列的逆序数. 输入 5 4 5 1 3 2 输出 7 #include <iostream&g...原创 2019-08-25 16:14:45 · 238 阅读 · 0 评论