Sunday, 2 April 2017

Spoj TRVCOST - Travelling cost

Spoj TRVCOST - Travelling cost




Simple Dijkstra implementation.Be sure to make 500 cells(Vertex) because in inputs only edges i.e. roads are given.
Java Solution for this problem is given below.

Labels: ,

Spoj MICEMAZE - Mice and Maze Java Solution

Spoj MICEMAZE - Mice and Maze Java Solution



Hint: - Problem can be solved by Dijkstra Algorithm. Reverse the given edges and use the given end cell as source cell(starting cell) and then count the cells that can be reached within given time limit.Java Solution using Dijkstra algorithm link is given below.

Labels: , ,