Maximum number of coloured nodes

Правка en1, от tcquery, 2019-03-26 08:48:20

You can colour nodes in a tree by “marking” some of the tree nodes. Marked nodes may not be closer to each other than distance D. Find the maximum number of nodes that you can mark. The nodes are numbered from 1 to N.

How do I solve this in better than O(n^2)

N,D<=2e5

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский tcquery 2019-03-26 08:48:20 309 Initial revision (published)