Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

How do I select maximum vertices in a graph in this case:-?

Правка en2, от umsh1ume, 2017-02-12 21:17:55

I need to select maximum vertices in a graph such that the distance between any two selected vertices is less than the given limit? distance between adjacent nodes is 1. Input n,d meaning number of nodes and the limit d, n-1 lines follows denoting edges. Example 6 5 2 1 2 3 4 2 1 6 5 6

Output 5 As all 5 vertices can be selected within the range d

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский umsh1ume 2017-02-12 21:17:55 192
en1 Английский umsh1ume 2017-02-12 21:15:20 230 Initial revision (published)