Relative Content

Tag Archive for treedepth-first-searchdisjoint-union

Minimal path on weighted tree query

given a weighted tree with n vertices. there are q queries and for each query, you are given integers (u,k). find number of vertices v such that the smallest edge on the route from u to v is equal to k. (n,q <= 1e5)