Tyler__Durden's blog

By Tyler__Durden, history, 6 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +20
  • Vote: I do not like it