Solve the question

Правка en1, от anshu2002, 2022-09-15 16:49:43
// there is a unrooted unweighted tree with n nodes numbered from 1 to n . You have to travel from 1 to n via some special nodes,
// so find the length of shortest path from 1 to n
// you can visit any node any number of times
// you have to visit special nodes atleast once
vector<int>edges = {{1,2},{1,3},{3,4},{3,5}};
vector<int>special_nodes = {2,4};
// ans : 6 (1->2->1->3->4->3->5)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский anshu2002 2022-09-15 16:49:43 431 Initial revision (published)