
普通线段树
文章平均质量分 77
TheWolfWhistlingSong
蜜の夜明け
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Bzoj2212:[Poi2011]Tree Rotations:线段树的合并
线段树的合并入门原创 2016-03-25 09:28:07 · 1443 阅读 · 0 评论 -
Bzoj3790:神奇项链:manacher+线段树+贪心
题目链接:3790:神奇项链 处理出每个位置的最长的回文串,然后就是用最少的回文串覆盖整个区间 贪心一下,线段树维护即可,每次在左端点在合法区间里的回文串中找右端点最远的即可 #include #include #include #include #include using namespace std; const int maxn=210000; const int inf=0x7fff原创 2016-07-14 15:52:38 · 454 阅读 · 0 评论 -
Bzoj3531:[Sdoi2014]旅行:树链剖分+动态开点线段树
题目链接:[Sdoi2014]旅行 对于每种颜色维护一颗线段树,为了节约空间这里我们动态开点 然后就是弱鸡的线段树操作了 指针的动态开点线段树现在才会写…… #include #include #include #include using namespace std; const int maxn=100010; const int maxc=100001; int n,m,tot=0,原创 2016-07-18 08:05:31 · 539 阅读 · 0 评论 -
Bzoj3533:[Sdoi2014]向量集:线段树+凸包+三分
题目链接[Sdoi2014]向量集 维护一颗线段树,线段树每个节点上有对应区间的上下凸壳 可以发现答案一定在凸壳上取得,所以在凸壳上三分即可,y>=0时在上凸壳上三分,否则在下凸壳 #include #include #include #include #include #define ll long long #define pb push_back #define pii pair #d原创 2016-06-23 19:21:19 · 553 阅读 · 0 评论