A hard tree problem, hope someone can help me, Thanks

Revision en2, by sadboi2009, 2024-05-10 19:09:15

I just encountered a difficult problem with no solution. Can someone help me, thanks in advance.

Given a tree with N vertices. There are Q queries, the ith query is represented by K pairs (v, r), all vertices whose distance from v is not more than r will be marked. Ask how many vertices are marked per query. Limit N <= 5e4, Q <= 5e5 + N, the total K of all queries does not exceed 5e5 + N.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English sadboi2009 2024-05-10 19:09:15 20
en1 English sadboi2009 2024-05-10 19:07:46 464 Initial revision (published)