线段树
文章平均质量分 58
DongGu.
一位 - 大三小混混
展开
-
一张图 + 我的坑!绝对让你有点明白 主席树 ->可持久化数组 -> 可持久化并查集
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int maxn = 2e5 + 5; int a[maxn]; vector<int> v; inline int getid(int x) { return lower_bound(v.begin(), v.end(), x) - v.begin() + 1; } struct No原创 2021-09-12 10:02:57 · 95 阅读 · 2 评论 -
Potted Flower POJ - 2750 骚的一批的线段树 ~~
#include<cstdio> #include<iostream> #include<algorithm> using namespace std; struct Node { int sum; //总区间 int lmin, lmax;//这个l r :为了求某段区间最大smax最小smin int rmin, rmax; int smax, smin;//某段区间 }tr[100005<<2]; #define lson l,m原创 2021-06-30 16:26:15 · 63 阅读 · 0 评论