![](https://img-blog.csdnimg.cn/20190918140129601.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
树上启发式合并
文章平均质量分 92
树上启发式合并
_sky123_
这个作者很懒,什么都没留下…
展开
-
Educational Codeforces Round 19 D. Broken BST
题目链接Let TTT be arbitrary binary tree — tree, every vertex of which has no more than two children. Given tree is rooted, so there exists only one vertex which doesn’t have a parent — it’s the root of a tree. Every vertex has an integer number written on it原创 2021-02-09 15:13:03 · 137 阅读 · 0 评论 -
阔力梯的树
链接:https://ac.nowcoder.com/acm/contest/4010/E来源:牛客网题目描述阔力梯有一棵树,这棵树有N{N}N个节点,每个节点按顺序编号为1−N{1-N}1−N,其中,1{1}1号节点是根结点。定义树上一个节点的“结实程度”为,将这个节点的子树中的所有的节点编号拿出来之后,按照从小到大的顺序排列,然后将相邻元素做差之后求平方和。即假设子树的节点编号排序后的序列为a1,a2,a3,...,aka_1,a_2,a_3,...,a_ka1,a2,a3,...,ak原创 2020-07-09 19:53:50 · 276 阅读 · 0 评论 -
Tree Requests
Roman planted a tree consisting of n vertices. Each vertex contains a lowercase English letter. Vertex 1 is the root of the tree, each of the n − 1n - 1n − 1 remaining vertices has a parent in the tree. Vertex is connected with its parent by an edge. The p原创 2020-05-16 09:34:44 · 235 阅读 · 0 评论 -
Arpa’s letter-marked tree and Mehrdad’s Dokhtar-kosh paths
Just in case somebody missed it: we have wonderful girls in Arpa’s land.Arpa has a rooted tree (connected acyclic graph) consisting of n vertices. The vertices are numbered 1 through n, the vertex 1 is the root. There is a letter written on each edge of t原创 2020-05-16 07:35:47 · 214 阅读 · 0 评论 -
Lomsat gelral(树上启发式合并/动态开点与线段树合并)
You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour.Let’s call colour c dominating in the subtree of vertex v if there are no other colours that appear in the subtree of vertex v more times than colour c. So it’s poss原创 2020-05-15 14:45:58 · 366 阅读 · 0 评论