| 
 | 
вернуться в форумIs there any easier solution? One way I can think of is to sort edge by cost and use dynamic connectivity   But it's very hard to implement :( What's the better solution? Re: Is there any easier solution? divide and conquer is ok. but i can't understand now .And i get T with dynamic connectivity. One way I can think of is to sort edge by cost and use dynamic connectivity   But it's very hard to implement :( What's the better solution? Re: Is there any easier solution? Lucky one, I have TL with this method.  |  
  | 
|