Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:28762Accepted:9964DescriptionAn ascending sorted sequence of distinct values i...
分类:
其他好文 时间:
2015-03-05 14:16:42
阅读次数:
202
题意:把冒泡排序的规则改了一下,每次循环可以对任意数进行一次冒泡,问最少需要多少次循环
思路:想一下就可以知道只要需要多少的数的右边有比它小的数
直接用一个tmpmin记录当前右边的最小值即可,我用了树状数组就当练习一下
#include
#include
#include
#include
using namespace std;
const int N=1e6+100 ;
int nu...
分类:
编程语言 时间:
2015-03-04 22:52:51
阅读次数:
186
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key ...
分类:
其他好文 时间:
2015-03-04 06:12:50
阅读次数:
170
#include#include#includeusing namespace std;struct Student{ char ID[10]; char name[10]; int gread;}STU[100010];bool cmp1(Student a,Student b){ ret...
分类:
其他好文 时间:
2015-03-01 20:56:07
阅读次数:
204
传送门:http://poj.org/problem?id=1094
Sorting It All Out
Description
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elem...
分类:
其他好文 时间:
2015-02-20 09:46:55
阅读次数:
159
Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:26801Accepted:9248DescriptionAn ascending sorted sequence of distinct values i...
分类:
编程语言 时间:
2015-02-18 16:24:49
阅读次数:
187
根据《数据结构与算法分析——Java语言描述》一书的顺序来总结的。插入排序(insertion sort)希尔排序(Shellsort)堆排序(heapsort)并归排序(mergesort)快速排序(quicksort)桶式排序(bucketsort)外部排序(external sorting)...
分类:
编程语言 时间:
2015-02-15 21:49:05
阅读次数:
178
1. 排序( sorting)
的功能是将一个数据元素的任意序列,重新排列成一个按关键字有序的序列。其确切的定义为:
假设有n个数据元素的序列{R1 ,
R2 ,
… , Rn},其相应关键字的序列是{K1 ,
K2 ,
… , Kn} ,通过排序要求找出下标 1
, 2 , … , n的一种排列p1 ,
p2 ,
… , pn,使得相应关键字满足如下的非递...
分类:
编程语言 时间:
2015-02-15 12:14:26
阅读次数:
182
这题题目的意思我跟hdu的确定比赛名次的要求搞混了,其实很容易。确定比赛名次的题意是在不确定顺序的时候,不能确定的顺序按照字母升序排列这边给出一些大小关系,而你的任务就是理清这些关系。然后就有一个全序,偏序的概念。具体的理论部分可以见:http://blog.csdn.net/dm_vincent/...
分类:
其他好文 时间:
2015-02-14 01:03:18
阅读次数:
218
我们的男主现在手中有n*c张牌,其中有c(#define eps 1e-9#define FOR(i,j,k) for(int i=j;i=dp[num]) { dp[++num]=p[i].hash; }else ...
分类:
其他好文 时间:
2015-02-11 12:37:29
阅读次数:
160