I use Vector to store linked list and the algo from text book to solve this program. I think it works well now. But the laozy OJ show me all crahed. Wondering......
I checked submission 34231 with uid 266.
This submission works under Java SDK 1.4.1 on my computer, but I am not sure whether it works under Java SDK 1.2.2.
I am quite sure that your algorithm is wrong, you should get a wrong answer feedback from OJ. Resubmit your program to the OJ and check what is the feedback.
[FEEDBACK]If i am not wrong...I checked submission 34231 with uid 266.
This submission works under Java SDK 1.4.1 on my computer, but I am not sure whether it works under Java SDK 1.2.2.
I am quite sure that your algorithm is wrong, you should get a wrong answer feedback from OJ. Resubmit your program to the OJ and check what is the feedback.
[FEEDBACK]If i am not wrong...I checked submission 34231 with uid 266.
This submission works under Java SDK 1.4.1 on my computer, but I am not sure whether it works under Java SDK 1.2.2.
I am quite sure that your algorithm is wrong, you should get a wrong answer feedback from OJ. Resubmit your program to the OJ and check what is the feedback.
No, I use for loop.But I use vector to store linked list.So that I can easily find the path after I add the last point to the node Vector.
may be you can
whenever you want to put a complete path into the vector, check the vector, and decide whether to discard the "path" in the vector(when it is longer than new path) or not put the new path(when it is longer than the path in the vector) into the vector.