考察的是结构体的二次快排
#include
#include
typedef struct Node{
int fir;
int end;
}Node;
Node node[110];
int cmp(const void *a,const void *b)
{
return (*(node *)a).end>(*(node *)b).end?1:-1;
}
i...
分类:
其他好文 时间:
2014-07-28 16:15:23
阅读次数:
218
#include
#include
#define MAXL 225+5
#define MAXN 10+5
char find[MAXN][MAXL],replace[MAXN][MAXL];
char text[MAXL],convert[MAXL];
int Find(int,int*);
void Replace(int,int);
int str_cmp(int,int);
i...
分类:
其他好文 时间:
2014-07-27 23:55:20
阅读次数:
273
#include #include using namespace std; #define max 100010 int a[max],b[max]; bool cmp(int a,int b){ return a>n){ for(int i=0;i>a[i]; b[i]=a[i]; ...
分类:
其他好文 时间:
2014-07-27 23:18:59
阅读次数:
438
struct mystat { int idx; int cnt[26]; mystat(int id = 0) {idx = id;}};bool cmp(const mystat &a, const mystat &b) { for (int i=0; i b.cnt[i...
分类:
其他好文 时间:
2014-07-27 21:53:19
阅读次数:
177
今天用python自带的sorted对一个列表进行排序, 在这里总结一下只要是可迭代对象都可以用sorted 。sorted(itrearble, cmp=None, key=None, reverse=False)=号后面是默认值 默认是升序排序的, 如果想让结果降序排列,用reverse=Tru...
分类:
编程语言 时间:
2014-07-26 14:49:40
阅读次数:
284
#include
#include
#include
int s[1050];
int dp[1050];
int cmp(const void *a,const void * b)
{
return *(int *)b-*(int *)a;
}
int maxx(int a,int b)
{return a>b?a:b;}
int main()
{
int n,i,j,sum,MA...
分类:
其他好文 时间:
2014-07-26 02:20:36
阅读次数:
193
# include
# include
# include
using namespace std;
struct node
{
int v;
int t;
};
struct node a[100010];
bool cmp(node a,node b)
{
return a.v *a.t+(a.v+b.v)*b.t<b.v*b.t+(a.v+b.v)*a.t;
}...
分类:
其他好文 时间:
2014-07-24 23:16:23
阅读次数:
268
# include
# include
# include
using namespace std;
struct node
{
int t;
int v;
int yy;
};
struct node a[100010],b[100010];
bool cmp(node a1,node a2)
{
if(a1.t==a2.t)//先按时间从大到小
return a1.v>a2....
分类:
其他好文 时间:
2014-07-24 23:10:33
阅读次数:
238
一、题目ZOJ 1093二、题目源程序#include //一个箱子有3种h..所以总共有3*n种高度.按面积从大到小排序#include struct block{ int x,y,z,h;}a[200];int cmp(const void *a,const void *b)//快排,模版{ r...
分类:
其他好文 时间:
2014-07-23 16:55:21
阅读次数:
198
原文来自于:http://www.oschina.net/translate/elasticsearch-getting-started?cmp教程样例我们将要部署一个非常简单的应用--在一个部门里的雇员--这样我们可以把注意力放在功能而不是氧立得复杂性上。总而言之,这篇博文是为了帮助人们开始Ela...
分类:
其他好文 时间:
2014-07-23 15:07:36
阅读次数:
213