P "nodes" tree

Правка en1, от ErisSimp, 2023-08-16 18:33:06

Given a tree with N nodes, node i-th has c[i] (let say it mean node i-th cost), find P (P is given) node that are connected, and the sum of P node's cost is minimum N<=100000 P<=N C[i]<=100000 output sum of P node's cost (i don't speak english so sorry if it bad)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ErisSimp 2023-08-16 18:33:06 282 Initial revision (published)