
Segment Tree
文章平均质量分 87
Southan97
本科计算机科学与技术专业,现软件工程专业在读研究生
展开
-
HDU 5306 Gorgeous Sequence
HDU 5306 Gorgeous Sequence There is a sequence a of length n. We use ai to denote the i-th element in this sequence. You should do the following three types of operations to this sequence. 0 x y t: For every x≤i≤y, we use min(ai,t) to replace the original原创 2017-04-11 16:19:06 · 419 阅读 · 0 评论 -
HDU 1698 Just a Hook 线段树区间更新求和
HDU 1698 Just a Hook 线段树区间更新求和 In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length.原创 2017-04-11 16:53:03 · 361 阅读 · 0 评论 -
HDU 2795 Billboard 线段树单点更新
Billboard Problem Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all poss原创 2017-04-11 17:23:53 · 348 阅读 · 0 评论 -
HUD 5323 Solve this interesting problem dfs剪枝搜索,重构线段树
HUD 5323 Solve this interesting problem dfs剪枝搜索,重构线段树 Have you learned something about segment tree? If not, don’t worry, I will explain it for you. Segment Tree is a kind of binary tree, it can be defined as this: - For each node u in Segment Tree, u has原创 2017-04-12 19:37:27 · 371 阅读 · 0 评论 -
HDU 5306 Gorgeous Sequence, Segment Tree Beats
常规的线段树可以用lazy标志来实现线段树的区间更新(区间覆盖,区间加减定值等),但是形如下面操作1却不是很好处理For all , change Ai to min(Ai, x)Query for the sum of Ai in [l, r] 可以参考2016年国家集训队论文集中的“区间最值与历史最值问题”——吉如一,关于求区间和、区间最值的问题可以用常规的线段树轻松解决...原创 2018-03-22 16:33:18 · 571 阅读 · 0 评论