摘要:
Description 给出一个n个节点的有根树(编号为0到n 1,根节点为0)。一个点的深度定义为这个节点到根的距离+1。 设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。 有q次询问,每次询问给出l r z,求sigma_{l include include includ 阅读全文
摘要:
题目背景 We could have had it all. . . . . . 我们本该,拥有一切 Counting on a tree. . . . . . 何至于此,数数树上 Counting on a Tree( CoaT)即是本题的英文名称。 题目描述 AccessGlobe最近正在玩一款 阅读全文
摘要:
E. Close Vertices You've got a weighted tree, consisting of n vertices. Each edge has a non negative weight. The length of the path between any two ve 阅读全文