线段树
onsterm
oi新生
展开
-
线段树入门之一
hdu1166#include<stdio.h>#include<string.h>#include<iostream>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int Maxn=50000+5; int sum[Max...原创 2018-06-06 22:10:42 · 95 阅读 · 0 评论 -
线段树入门之二
hdu1754#include<stdio.h>#include<iostream>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int Maxn=200000+5;int ma[Maxn*4];int max(int i,int j)...原创 2018-06-06 22:13:59 · 85 阅读 · 0 评论 -
线段树入门之三
hdu2795#include<stdio.h>#include<iostream>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1int h,w,n;const int Maxn=200005;int f[Maxn*4];void pushdow...原创 2018-06-06 22:34:30 · 94 阅读 · 0 评论 -
线段树入门之四
poj2828#include<stdio.h>#include<iostream>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int Maxn=200005;int sum[Maxn*4],ans[Maxn*4];void push...原创 2018-06-06 23:07:08 · 94 阅读 · 0 评论