||lemme tell at the outset..
i am new to the topcoder.
I read the article by written gladius and found it very helpful....
I tried the same problem (SRM 156 Division 1, 900) whose algorithm has been explained clearly in the article (using DFS).
I followed the pseudo code described in the article.
But upon system testing , my java code is giving the error :
java.lang.OutOfMemoryError : Memory heap space.
How can i fix it ??
Do the algo need to be more efficient or there is any fault on my part..
may be gladius himself or somebody else suggest soemthing !!!
(do not suggest to use -Xmx -Xms, i cannot use it on topcoder)