REVERSE - Editorial

In the tester’s solution, values are queued when their tentative distances are updated. This allows for the possibility of re-queuing verticies that are already in the queue. Why would we do this?

Why is your modifies bfs working faster than Djiktra algorithm?
Here are my two solution using bfs(http://www.codechef.com/viewsolution/4560098) and using Djiktsta (http://www.codechef.com/viewsolution/4557359)

I tried implementing the method suggested by @asheshvidyut in Python. The result is here : http://www.codechef.com/viewsolution/4563220.
However, I exceed the time limit. I also rewrote the code with a merge to make it faster (but less readable), but I still get a TLE : http://www.codechef.com/viewsolution/4563280.

Am I doing something wrong or is Python inherently too slow ?

can some one please check this
http://www.codechef.com/viewsolution/4832243
and tell me where i did the mistake

can someone plz check whts wrong in this
http://www.codechef.com/viewsolution/4842001

Solution

Question

Can anyone help me why my code fails on this question?
Thank you!

@shivam217

how bfs could give solution for the shortest path.

I tried to submit this in D, and got a SISEGV!. Here’s the link to my submission: codechef.com/viewsolution/10597167
Then I just translated the same code to C++, and it was accepted!!!:
Here’s the link: codechef.com/viewsolution/10598114
The D version executed fine on my system (gdc 5.1). Can anyone please explain???

I have use dijkstra but getting tle can anybody help me in finding the reason
https://www.codechef.com/viewsolution/11997317

I have use dijkstra but getting tle can anybody help me in finding the reason
https://www.codechef.com/viewsolution/11997317