#include
#include
#include
#include
using namespace std;
#define INF 0x3fffffff
typedef struct
{
int w,s;
}N;
N node[10000];
int dp[10000];
int cmp(N n1,N n2)
{
if(n1.s==n2.s)
retu...
分类:
其他好文 时间:
2015-01-21 20:07:39
阅读次数:
141
//挺有收获的
//qsort Demo
#include
#include //qsort
#include
using namespace std;
int cmp_int(const void *a,const void *b)
{
return *(int *)a - *(int *)b;
}
int cmp_char(const void *a,const void *...
分类:
其他好文 时间:
2015-01-20 22:23:09
阅读次数:
187
void splay(Node * &o,int k)
{
int d=o->cmp(k);//cmp函数比较的是k和o->ch[0]->s+1的大小
if(d==1) k-=o->ch[0]->s+1;
if(d!=-1)
{
Node *p=o->ch[d];
int d2=p->cmp(k);
i...
分类:
其他好文 时间:
2015-01-20 10:32:20
阅读次数:
143
1 / you can write to stdout for debugging purposes, e.g. 2 // printf("this is a debug message\n"); 3 #include 4 5 int cmp(const void*p1,const void*...
分类:
编程语言 时间:
2015-01-19 01:34:39
阅读次数:
218
我要翻译题目!!!/*A group of cows grabbed a truck and ventured on anexpeditiondeep into the jungle. Being rather poor drivers, the cows unfortunately managed...
分类:
编程语言 时间:
2015-01-18 19:41:57
阅读次数:
394
大水题一发 弄清长方体的几个面的关系就行了
#include
#include
using namespace std;
const int N = 6;
struct rec{ int l, w;} r[N];
bool cmp(rec a, rec b)
{
return a.w < b.w || (a.w == b.w && a.l < b.l);
}
int main()
...
分类:
其他好文 时间:
2015-01-17 22:14:11
阅读次数:
224
(ob1 is ob2) 等价于 (id(ob1) == id(ob2)) 首先id函数可以获得对象的内存地址,如果两个对象的内存地址是一样的,那么这两个对象肯定是一个对象。和is是等价的。Python源代码为证。1234567891011static PyObject *cmp_outcome.....
分类:
编程语言 时间:
2015-01-15 19:55:56
阅读次数:
224
在项目当中有要用到map按key排序的需求,就在百度上搜了一下:typedef pair PAIR;int cmp(const PAIR& x, const PAIR& y){return x.second imgdis; //待排序对象,根据double值排序imgdis[1] = 3;imgd....
分类:
编程语言 时间:
2015-01-08 22:36:40
阅读次数:
558
E/AndroidRuntime( 1516): java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.autonavi.xmgd.navigator/.SelectPath_Available } from ProcessRecord{415b7c00 1516:com.f...
分类:
其他好文 时间:
2015-01-08 18:06:43
阅读次数:
267
E/AndroidRuntime( 1516): java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.autonavi.xmgd.navigator/.SelectPath_Available } from ProcessRecord{415b7c00 1516:com.f...
分类:
其他好文 时间:
2015-01-08 18:05:43
阅读次数:
174