CF516D 题解

CF516D 题解

$\text{Description}$

给定一棵 $n$ 点有边权无根树,定义 $d(i)=\max\limits_{1\le j\le n}\{\operatorname{dis}(i,j)\}$。接下来 $q$ 次询问,每次询问给定 $l$,求一个连通块 $S$,在满足 $\forall i,j\in S,d(i)-d(j)\le l$ 的情况下,最大的 $|S|$。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×