- 博客(14)
- 收藏
- 关注
原创 杭电2171
#include #include #include using namespace std;string s,temp;string s1[1005];int main(){ int t,num,i,pos1,pos2,len,n,j; cin.sync_with_stdio(false); cin>>t; while(t--) { pos1=0; num=1;
2016-08-22 17:50:40 256
原创 区间最大值-杭电5124
#include #include #include #include #define maxn 200005using namespace std;int sum[maxn<<2];int col[maxn<<2];struct node{ int id,x;}a[maxn];int num[maxn/2][2];bool cmp(node X,node Y){ r
2016-08-22 11:56:59 434
原创 线段树成段更新-杭电4107
#include #include #include using namespace std;#define maxn 200010struct node{ int Max,Min; int flag;}num[maxn<<2];int P;void Down(int rt){ if(num[rt].flag) { num[rt<<1].Max+=num[rt].f
2016-08-17 22:29:53 342
原创 线段树成段更新化为单点更新-杭电4027
#include #include #include #include using namespace std;#define maxn 100010long long num[maxn<<2];void up(int rt){ num[rt]=num[rt<<1]+num[rt<<1|1];}void build(int L,int R,int rt){ if(L==R
2016-08-17 19:28:35 257
原创 线段树成段更新+延迟标记法-杭电3911
#include #include #include using namespace std;#define left L,m,rt<<1#define right m+1,R,rt<<1|1 #define maxn 100010struct node{ int l1,l0; int r1,r0; int m1,m0; int flag; int l,r;}sum[m
2016-08-17 17:42:34 311
原创 线段树扫描线-杭电3255
#include #include #include #include #define maxn 160005#define LL long longusing namespace std;struct node{ LL x1,x2,y; LL c,v; node(long long x1=0,long long x2=0,long long y=0,long long c
2016-08-17 15:06:04 203
原创 线段树区间交-杭电1255
#include #include #include #include using namespace std;#define maxn 10010struct node{ double x1,x2,y; int cover; node(double x1=0,double x2=0,double y=0,int cover=0):x1(x1),x2(x2),y(y),cove
2016-08-16 16:09:36 218
原创 线段树面积并-杭电1542
#include #include #include #include using namespace std;#define maxn 100010struct node{ double x1,x2,y; int cover; node(double x1=0,double x2=0,double y=0,int cover=0):x1(x1),x2(x2),y(y),c
2016-08-16 15:04:46 261
原创 线段树单点更新-杭电3874
#include #include #include #include using namespace std;#define maxn 200010struct node{ int r,l,pos;}p[maxn];long long sum[maxn<<2];int visit[1000010];int a[50010];long long num[maxn];bo
2016-08-15 22:58:01 241
原创 线段树区间合并模板-杭电1540
#include #include #include #define maxn 50010using namespace std;struct { int l; //记录左边界 int r; //记录右边界 int rl,ll,ml; //左边开始的最大连续长度, //以及右边开始的连续最大长度,还有整个区间的最大连续长度 }SegTree[maxn<<2];int
2016-08-15 17:20:11 325
原创 线段树成段更新模板-杭电1556
#include #include #include #define left L,m,rt<<1#define right m+1,R,rt<<1|1#define maxn 100050int flag;int sum[maxn<<2];void down(int rt){ if(sum[rt]) { sum[rt<<1]+=sum[rt]; sum[rt<<1|1]
2016-08-15 15:37:19 278
原创 线段树单点更新模板-杭电1166
#include #include #include using namespace std;#define LL long long#define left L,m,rt<<1#define right m+1,R,rt<<1|1LL num[200010];void update(int rt){ num[rt]=num[rt<<1]+num[rt<<1|1]; }vo
2016-08-15 14:50:58 199
原创 杭电4504
#include #include #include using namespace std;int main(){ long long i,j,A,B,t,score,n,num; long long dp[30][100]; memset(dp,0,sizeof(dp)); dp[0][0]=1; for(i=1;i<22;i++) { for(j=63
2016-08-05 17:05:38 206
原创 杭电2845
#include #include #include using namespace std;int dp[200002];int num[200002];int x[200002];int main(){ int M,N,i,j; while(~scanf("%d%d",&M,&N)) { memset(dp,0,sizeof(dp)); for(i=1;i<=M;
2016-08-05 15:14:11 243
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人