线段树维护的是区间有多少个空位置,每次查询第X个空位置在哪,sum[rt]>=X就向左区间找,sum[rt]
#include
#include
#include
using namespace std;
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
const int maxn = 55555;
int...
分类:
其他好文 时间:
2014-05-15 20:19:48
阅读次数:
256
和上一题一样,寻找第K个位置,只不过需要处理一下下一个位置在哪,画图看看就知道了。
#include
#include
#include
using namespace std;
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
const int maxn = 30000+5;
int sum[maxn<<...
分类:
其他好文 时间:
2014-05-15 20:07:28
阅读次数:
262
const限定符全解
一、const 修饰普通变量
int const a = 500;
const int a = 600;
上述两种情况相同,都是声明一个const型的变量,它们的含义是:变量a的值不可改变!
二、const 修饰 指针
int b = 500;
const int * a = &b;...
分类:
编程语言 时间:
2014-05-15 19:57:22
阅读次数:
415
java-类生命周期(二),理论联系实际,例子剖析...
分类:
编程语言 时间:
2014-05-15 19:22:14
阅读次数:
370
1,指针作为函数参数,指针可以指向内存中任意一个数据,通过间接引用能够在函数内修改函数外甚至系统中的数据;为了避免指针作为函数参数导致数据被意外修改,我们可以使用const来保护指针所指向的数据;2,指针作为函数返回值,同别的数据类型int,float一样,指针也能够作为函数的一种返回值类型,把返回...
分类:
其他好文 时间:
2014-05-15 17:36:11
阅读次数:
337
//#define
LOCAL#include#include#include#includeint const MAX_N=1001;typedef struct Point{
double x,y; bool operatorVec[i].y) { ...
分类:
其他好文 时间:
2014-05-15 13:51:08
阅读次数:
230
MFC虽然没有未来,但是我觉得MFC的思想还是有必要研究研究的,在MFC中或者一些底层代码的编写中,宏是相当好用的,为什么呢?因为宏只是简单的替换,不进行类型转换,替换就意味着灵活,而C语言编程的灵魂就是灵活埃但是在高级语言中,甚至C++中,是提倡用const的,不提倡用#de..
分类:
编程语言 时间:
2014-05-15 12:47:17
阅读次数:
334
tarjan算法第一题
喷我一脸。。。。把手写栈的类型开成了BOOL,一直在找错。。。
#include
#include
#include
#include
#define maxn 100005
const int MOD=1000000007;
using namespace std;
struct node
{
int to,next;
}edge[maxn...
分类:
其他好文 时间:
2014-05-15 08:18:56
阅读次数:
353
MySQL has a number of global buffers, i.e. your
SGA. There are also a number of per session/thread buffers that combined with
other memory usage const...
分类:
其他好文 时间:
2014-05-15 07:34:17
阅读次数:
307