@ssjgz @cubefreak777 @suman_18733097 @cherry0697

plz have a look

Link to the problem .

The solution for this problem is dijekstra with reverse edges .

But how is it possible

Consider following testcase .

4

2

1

8

1 2 2

1 3 1

2 1 1

2 4 1

3 1 1

3 4 1

4 2 2

4 3 1

here we have 4 nodes and 8 edges

and end cell is 2 and if mice are placed at 1 and 4 their minimum distance will be 1 and 1 from 2 using dijestra with reverse edge .

But as we can see from edges the weight of edge 1 to 2 is 2 and same for 4

then how can we minimize the distance using weight of edge from 2 to 1 . as mice is placed in 1 it should be minimized using weight of edge from 1 to 2 but dijestra with reverse edges reduces dist using edges from 2 to 1 like

you have to go from 1 to 2 and your are minimizing dist using edge 2 to 1 instead of minimizing it using edge from 1 to 2 .

But we have travel from 1 to 2 how can we minimize this distance using edge 2 to 1