区间操作
hbulzh
这个作者很懒,什么都没留下…
展开
-
POJ3468 线段树A Simple Problem with Integers
我还是第一次见一会对 一会不对的评测系统。。。一样的代码 一次对一次不对?? #include<iostream> #include<algorithm> #include<cstring> #define lc rt<<1 #define rc rt<<1|1 using namespace std; const int maxn ...原创 2019-12-06 21:52:04 · 68 阅读 · 0 评论 -
POJ3264 区间最大减区间最小
区间操作,线段树和打表都行,主要打表的操作老是加一和减一搞晕,重写一遍找找感觉 #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int maxn = 5e4+10; int n,m,a[maxn]; int dp1[maxn][80],dp...原创 2019-12-06 20:18:59 · 91 阅读 · 0 评论 -
POJ3321 苹果树
体会一下 树状数组是怎么用的,还是太菜了 #include<iostream> #include<cstring> using namespace std; const int maxn = 3e5+10; int L[maxn],R[maxn],timing; int c[maxn],a[maxn]; int tot,head[maxn]; struct Edge{...原创 2019-12-06 19:58:26 · 114 阅读 · 0 评论 -
线段树模板
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 5e5+7,inf = 0x3f3f3f3f; ll n,m,opt,l,r; struct node{ ll lsum,rsum,sum,Ans; void update(ll x){ ...原创 2019-12-03 21:42:33 · 81 阅读 · 0 评论 -
线段树模板
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 5e5+7,inf = 0x3f3f3f3f; ll n,m,opt,l,r; struct node{ ll lsum,rsum,sum,Ans; void update(ll x){ ...原创 2019-11-09 11:12:15 · 105 阅读 · 0 评论