在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数。
分类:
其他好文 时间:
2014-07-19 20:24:57
阅读次数:
198
Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:26876Accepted:9271DescriptionAn ascending sorted sequence of distinct values i...
分类:
其他好文 时间:
2014-07-19 15:03:58
阅读次数:
278
Ultra-QuickSort
Time Limit: 7000MS
Memory Limit: 65536K
Total Submissions: 39767
Accepted: 14336
Description
In this problem, you have to analyze a particular sorting...
分类:
其他好文 时间:
2014-07-19 11:18:44
阅读次数:
156
/*
ID: lucien23
PROG: sort3
LANG: C++
*/
#include
#include
#include
#include
using namespace std;
void exchange(int nums[], int begin, int end, int N, int x);
int sum = 0;
int main()
{
ifstream ...
分类:
其他好文 时间:
2014-07-19 02:12:25
阅读次数:
176
Sorting It All Out
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 26866
Accepted: 9267
Description
An ascending sorted sequence of distinct values...
分类:
其他好文 时间:
2014-07-18 11:33:31
阅读次数:
294
时间:0.25s空间:4m题意: 其实就是求无环第K短路。 输入: 给出n,m,k,分别代表,n个点,m条边,第k长路。 接下来m行,三个整数x,y,z,分别代表x,y之间有条费用为x的双向路。保证没有重边。输出: 第一行两个数a,b,第k小费用a,和经过的点的...
分类:
其他好文 时间:
2014-07-16 19:31:00
阅读次数:
179
题目如下:
Mapping the Swaps
Sorting an array can be done by swapping certain pairs of adjacent entriesin the array. This is the fundamental technique used in the well-knownbubbl...
分类:
移动开发 时间:
2014-07-16 17:08:59
阅读次数:
252
Ultra-QuickSort
Description
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence eleme...
分类:
其他好文 时间:
2014-07-16 09:00:13
阅读次数:
240
Balance
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 10241
Accepted: 6330
Description
Gigel has a strange "balance" and he wants to poise it. Actually, ...
分类:
其他好文 时间:
2014-07-15 22:42:22
阅读次数:
272
点击打开链接
类似A strange lift的写法,之前一直返回RE,感觉有点不科学,数据较小。后来看discuss,居然输入还要考虑去重。
题意:略;
解析:最短路问题,但是有两种情况,因此需要根据具体情况来考虑。我采用的是构造两张图,然后在使用Dijkstra中将dis与cost放在一个结构体中,便于理解。其它就是A strange lift的一点变形
#include
#inc...
分类:
其他好文 时间:
2014-07-14 13:13:17
阅读次数:
288