Need Help in SPOJ Problem(Maximum Spanning Tree)

Правка en4, от _invincible_, 2020-07-23 16:35:33

Problem-MARYBMW

**My Approach:- ** At first,I've created a maximum spanning tree from the given data using kruskal algorithmn, Again , i had found the shortest path from 1 to n and take the minimum edge weight which would be our ans as obvious. Everthing worked fine but getting Time Limit Exceeded(TLE). Please correct me if I am wrong in any of my approach

Link to My Code

Need Help..I am getting TLE on test 15 and can't figure out how can I make it faster. Any help would be appreciated.

Теги #graph theory, spanning tree, kruskal, #bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский _invincible_ 2020-07-23 16:35:33 23
en3 Английский _invincible_ 2020-07-23 16:34:51 2113
en2 Английский _invincible_ 2020-07-23 16:31:44 2523
en1 Английский _invincible_ 2020-06-30 12:35:44 261 Initial revision (published)