![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
文章平均质量分 74
普通网友
这个作者很懒,什么都没留下…
展开
-
hdu 4455 Substrings # dp / 线段树
dp解法 1s 注意long long ,dp[I+1] = dp[I] 减去因为长度增加而少掉的最后一组的权值,再加上不重复的数字,即与前一个相同值大于长度I的值。 #include #include #include #include using namespace std; const int MAX = 1000100 ; typedef long long ll ; in原创 2017-09-14 17:17:58 · 392 阅读 · 0 评论 -
线段树专题(持续更新)
单点更新,单点/区间查询 hdu 1166 / 模板 #include #include #include #include #include #include using namespace std; typedef long long ll ; const int M = 50005 ; int sum[M << 2 ] ; void push_up(int node )原创 2017-09-14 10:52:27 · 252 阅读 · 0 评论 -
Invertible tree 线段树 + dfs 序
#include #include #include #include #include using namespace std; int const SIZE = 100100; typedef long long weight_t; struct edge_t{ int to; int next; }Edge[SIZE<<1]; int Vertex[SIZE];原创 2017-10-15 22:41:03 · 227 阅读 · 0 评论