Getting WA in Spoj problen:-BENEFACT — The Benefactor using DIjkstra but getting AC using BFS. Why?

Правка en3, от VIKRAM91, 2018-05-24 15:26:55

I am doing BENEFACT — The Benefactor.

I am using 2-time BFS method to calculate the longest path. Because here cost is associated with every edge so I am doing 2 times Dijkstra instead of 2 times BFS. But I am getting WA.

Can Anyone tell me Why I am getting WA?

Here is my code.

Edit:- Now I have done uknowg BFS instead of Dijkstra and I got Ac. Here is my code.

I want to now why solution using Dijkstra give WA and BFS gives AC.

Can Anyone help me? Please

Теги spoj, dijkstra, #graph, longest path

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский VIKRAM91 2018-05-24 15:26:55 2187
en2 Английский VIKRAM91 2018-05-24 13:42:08 16
en1 Английский VIKRAM91 2018-05-24 13:39:17 2248 Initial revision (published)