#include //注意两点,桌子可能从编号高的房间推到编号低的房间。如果2 3 ,4 5也是要分两次进行。因为3和4在同一走廊。
#include
#include
using namespace std;
struct node
{
int star,end;
}c[205];
bool cmp(node x,node y)
{
if(x.star<y.star) return...
分类:
其他好文 时间:
2015-04-21 11:13:54
阅读次数:
122
七种qsort排序方法
一、对int类型数组排序
int num[100];
Sample:
int cmp ( const void *a , const void *b )
{
return *(int *)a - *(int *)b;
}
qsort(num,100,sizeof(num[0]),cmp);
二、对char...
分类:
其他好文 时间:
2015-04-18 14:36:09
阅读次数:
108
python sorted排序Python不仅提供了list.sort()方法来实现列表的排序,而且提供了内建sorted()函数来实现对复杂列表的排序以及按照字典的key和value进行排序。sorted函数原型sorted(data, cmp=None, key=None, reverse=Fa...
分类:
编程语言 时间:
2015-04-18 14:23:39
阅读次数:
148
名称(省略双划线)
说明
call
为实例添加调用方法,如实例x是Class C的实例,则调用x()时会调用Class的call方法
cmp
比较方法
del
垃圾回收之前会调用,开发的时候要小心使用这个方法,因为这个方法可能会引起不会进行GC
delattr
当要求解除绑定关系时,会调用这个方法
...
分类:
编程语言 时间:
2015-04-16 17:43:16
阅读次数:
226
#include
#include
#include
#include
#include
using namespace std;
#define maxn 10000
#define eps 1e-8
struct
{
int w, v;
}a[maxn];
double b[maxn];
int n, k;
bool cmp(double a, double b)
...
分类:
其他好文 时间:
2015-04-15 19:39:16
阅读次数:
122
indexv2_index_cmp_job_base_9_delta_checktime:v2_index_cmp_job_base_9{source=cmp_job_base_9_delta_checktime错误出在这一行,索引文件名错path=/data/coreseek_data/job_v2/v2_index_cmp_job_base_9_delta}解决:indexv2_index_cmp_job_base_9_delta_checktime:v2_index_c..
分类:
其他好文 时间:
2015-04-14 20:19:18
阅读次数:
381
#include
#include
#include
using namespace std;
int n,m;
struct e
{
char a[200];
int id;
int px;
}s[200];
int cmp(e s1,e s2)
{
if(s1.px==s2.px) return s1.id<s2.id;
else return s1....
分类:
其他好文 时间:
2015-04-14 08:35:35
阅读次数:
171
/*
*m=a[k]×10k-1+a[k-1]×10k-2+….+a[2]×10+a[1]
*其中a[0]保存该长整数的位数。
*
*模拟笔算
*/
#include
#include
using namespace std;
#define SIZE 255
void getl(char* n);//获取长整数
void prt(char* n);//打印长整数
int cmp(char* n...
分类:
其他好文 时间:
2015-04-08 15:04:43
阅读次数:
139
#include
using namespace std;
const int N = 100000;
int num[N];
int sa[N], rank[N],height[N];
int wa[N], wb[N], wv[N], wd[N]; int cmp(int *r, int a, int b, int l)
{
return r[a] == r[b] &...
分类:
编程语言 时间:
2015-04-06 12:56:23
阅读次数:
212
zoj 3202 Second-price Auction
水题,不解释了,直接贴代码
#include
#include
#include
#include
using namespace std;
struct node{
int x;
int y;
};
struct node number[105];
int cmp(struct node a,struct node b){...
分类:
其他好文 时间:
2015-04-06 01:08:18
阅读次数:
231