
树剖
文章平均质量分 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 · 289 阅读 · 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.InputIn the原创 2020-11-05 21:18:36 · 239 阅读 · 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 · 276 阅读 · 0 评论 -
采蘑菇的克拉莉丝
克拉莉丝在玩一个采蘑菇的游戏。游戏地图是一张N个节点,N-1条边的连通无向图。一开始起点在1号点。游戏过程中会发生两种事件:1 v x(1≤x≤10^5)表示在编号为v的节点新出现了x个蘑菇2 v 表示克拉莉丝的起点变成了节点v在每个事件之后,克拉莉丝想要知道,他收集完所有的蘑菇所需的代价。蘑菇的收集规则是这样的,对于每个蘑菇,克拉莉丝要收集它,所需要的代价是这个蘑菇所在节点和起点之间的...原创 2020-01-21 17:58:43 · 297 阅读 · 0 评论