Sheldon and the mission

qstn:----

http://www.codechef.com/DCL1501/problems/DCL2015D

can anyone provide me the Editorial for this question

Thank you

Here is my solution.

Basically for all N vertices, construct a graph with N^2 edges where vertex i represents point (x[i],y[i]).
Weight of the edge between vertex i and j will be distance between the two points.

Source vertex will be (0,0) and destination vertex will be given.

Run dijkstra’s algorithm from the source vertex and determine the minimum distance between the source and the destination.

1 Like

Here’s the editorial : http://discuss.codechef.com/questions/65784/dcl2015d-editorial

1 Like