JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (oldest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
Re: SRM 198 system testing failed...!!! (response to post by sumantbhardvaj) | Reply
ok..

i fixed it ..no need of replies..

Actually , there was problem in the implementation of dijkstra itself.
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)
{
x=x1;
y=y1;
time=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...
RSS