
树
文章平均质量分 61
Xi_7997
一只啥也不会的蒟蒻
本博客暂时不再使用
展开
-
codeforces COMPFEST-13 I. Illusions of the Desert 树剖
I. Illusions of the Desert(rating: 2300)链接https://codeforces.com/contest/1575/problem/I题意给一棵n个节点的树,点权为ai 。要求对链做区间查询,单点修改。查的是边权和,边权的定义为: wab = max(|ax+ay|,|ax−ay|)。input6 410 -9 2 -1 4 -61 55 45 66 26 32 1 21 1 -32 1 22 3 3output39320原创 2021-10-18 19:56:05 · 262 阅读 · 0 评论 -
Codeforces 1566E Buds Re-hanging
Codeforces 1566E Buds Re-hanging(rating :2000)链接http://codeforces.com/problemset/problem/1566/E题意给一棵树,根节点为1,定义一种叫 Bud(芽)的东西 ------ 该节点不是根节点,有孩子且孩子全都是树叶(leaf)。每次操作可以将芽重新连接到树上的任意位置,要求最小化树叶的数量,直接输出结果。input571 21 31 42 52 64 761 21 32 42 5原创 2021-10-14 00:05:01 · 177 阅读 · 0 评论