- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 Segment Tree Template
#define lson l,m,n<<1 #define rson m+1,r,n<<1|1 int num[MAXN],sum[MAXN<<2],max[MAXN<<2],add[MAXN<<2]; void pushUp(int n) { sum[n]=sum[n<<1]+sum[n<<1|1]; max[n]=max(max[n<<1],max[n<<1|1]); } void
2014-02-11 10:38:52 838 1
原创 Binary Indexed Tree Template
//memset c 0 before use int c[MAXN]; //n -> update place //v -> update value void update(int n,int v) { for(;n<=MAXN;n+=(n&-n)) c[n]+=v; } //get the sum from 1 to n (BIT starts from 1) int read(i
2014-02-11 10:38:12 793 3
Android Apps for Absolute Beginners
2013-11-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人