|
|
back to boardWtf is wrong with Test #3 ?!?!?!??! Dijkstra not working here??? I did Dijkstra algorithm for S to F, but seems to exceeds time on test #3 ? Anyone got a clue? Tnx in advance Re: Wtf is wrong with Test #3 ?!?!?!??! Dijkstra not working here??? Well, I do not know what this test is, but the answer for this test is "No solution". Re: Wtf is wrong with Test #3 ?!?!?!??! Dijkstra not working here??? I don't know how to solve this problem with Dijkstra algorithm. My approach is another. Perhaps one pair of tests below can help you to understand the problem more clearely: 7 7 1 2 10 2 3 10 3 4 5 1 5 1 5 6 50 6 7 50 7 3 50 1 4 ans: 156 7 7 1 2 10 2 3 10 3 4 5 1 5 50 5 6 50 6 7 50 7 3 50 1 4 ans: 205 Re: Wtf is wrong with Test #3 ?!?!?!??! Dijkstra not working here??? What you need to do is to find the path with maximum weights of all edges while Dijkstra tries to find minimum. You're solving the wrong problem. |
|
|