![](https://img-blog.csdnimg.cn/20190918140158853.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
树剖
文章平均质量分 94
树剖
_sky123_
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #703 (Div. 2) F. Pairs of Paths
题目链接 You are given a tree consisting of nnn vertices, and mmm simple vertex paths. Your task is to find how many pairs of those paths intersect at exactly one vertex. More formally you have to find the number of pairs (i,j)(i, j)(i,j) (1≤i<j≤m)(1 \leq i原创 2021-02-19 20:43:53 · 267 阅读 · 0 评论 -
2019 ICPC南昌邀请赛 J Distance on the tree
题目链接 A tree with nnn nodes, which is numbered from 111 to nnn. Edge between each two adjacent vertexes uuu and vvv has a value www, you’re asked to answer the number of edge whose value is no more than kkk during the path between uuu and vvv. Input In the原创 2020-11-05 21:18:36 · 218 阅读 · 0 评论 -
A National Pandemic
链接:https://ac.nowcoder.com/acm/contest/5672/C 来源:牛客网 题目描述 Nowadays, the Kingdom of Dreamgrid is suffering from a national pandemic. Fortunately, president Baobao is working effectively with the Center for Disease Control (CDC) and they are trying their bes原创 2020-08-06 08:06:09 · 236 阅读 · 0 评论 -
采蘑菇的克拉莉丝
克拉莉丝在玩一个采蘑菇的游戏。游戏地图是一张N个节点,N-1条边的连通无向图。一开始起点在1号点。游戏过程中会发生两种事件: 1 v x(1≤x≤10^5)表示在编号为v的节点新出现了x个蘑菇 2 v 表示克拉莉丝的起点变成了节点v 在每个事件之后,克拉莉丝想要知道,他收集完所有的蘑菇所需的代价。蘑菇的收集规则是这样的,对于每个蘑菇,克拉莉丝要收集它,所需要的代价是这个蘑菇所在节点和起点之间的...原创 2020-01-21 17:58:43 · 272 阅读 · 0 评论