Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя Tyler__Durden

Автор Tyler__Durden, история, 6 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +20
  • Проголосовать: не нравится