Yet Another Tree Problem

Правка en2, от Tyler__Durden, 2018-11-28 01:02:04

I am stuck on this following problem:

Given an undirected tree of n nodes and q queries of type (u,d), for each query you need find the number of simple paths starting from node u and having edge distance <=d.

Constraints:

1<=n,q,u,d<=100000

Any suggestion will be highly appreciated. Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Tyler__Durden 2018-11-28 01:02:04 5 Tiny change: 'nd having distance ' -> 'nd having edge distance '
en1 Английский Tyler__Durden 2018-11-28 00:59:34 327 Initial revision (published)