Here is an unweighted tree with n vertices along with Q queries. Each query consists of three integers a, b, c. Please find three vertices X, Y, Z such that the distance between X and Y is a, the distance between X and Z is b, and the distance between Y and Z is c.The distance of two vertices is the number of edges in the simple path between them.
Here is an unweighted tree (Graph theorem literature) with n vertices along with Q queries. Each query consists of three integers a, b, c. Please find three vertices X, Y, Z such that the distance between X and Y is a, the distance between X and Z is b, and the distance between Y and Z is c. The distance of two vertices is the number of edges in the simple path between them.
标签: HBC51673AnEasyProblem 数据结构 堆/优先队列 贪心 二分 分治three points 2题解