spoj TSHPATH, SHPATH – The Shortest Path

you can find the problem statement from here.

the problems main motive is develop an optimised version of Dijkstra’s Algorithm but you can easily get an AC(without even using fastIO) by simply using the property that the node that you took from heap is the final minimum distance to that node from source if all of the weights in the graph are non-negative.

still I don’t know how some got it to 0.00 :O

as this problem is mainly about measuring the efficiency of your code instead of solving, it is very hard to have a python solution(currently there are 0) and the prototyping the problem in the python instead of going right into c++, really helped me a lot.

https://gist.github.com/cf85701fcd7e2cad0500

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s