Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
SRM 198 system testing failed...!!! | Reply
Its the 500 problem of SRM 198 DIV I.The name of the problem is "Dungeon Escape".

I am using dijkstra to solve this problem ..but my program has failed system testing.I think my Comparator is not designed properly..

for each movement , i have stored the position (Level and room) and time of the person and comaprator goes like this ..

class room implements Comparable
public int time;
public int x,y;
public room(int x1,int y1,int a)

public int compareTo(Object o)
room right = (room)o;
if (time < right.time) return -1;
if (time >=right.time) return 1;
return 0;

What exactly should i do in the comparator when time is same ..

plz suggest something...
Re: SRM 198 system testing failed...!!! (response to post by sumantbhardvaj) | Reply

i fixed it need of replies..

Actually , there was problem in the implementation of dijkstra itself.