|
|
вернуться в форумTest 13 Послано RR 20 окт 2012 21:05 Hi, At first my program finds the flights that lead to smallest time, and get WA13. Then I modified one line: trace(target, bestTime); to trace(target, timeInInput); and got accepted. I already added edges from (u,t) --> (u,t') for t' > t, so that if my bfs finds a path to (u,t), it should also find a path to (u,t') for all t' >= t. So I think either judge is incorrect, or test data is weak (such that my wrong code got accepted). The judge is correct. Hi, I encountered the same result (WA @ 13) as you did, and after a second thought, I realized that we had misunderstood the problem statement, in which an important sentence shall be noted: "Since such a meeting would likely be fatal, it cannot be allowed until the job is done." Remember that you need to wait for the rebel leader to appear at TIME_IN_INPUT. Therefore, if you take another round-trip to arrive at sometime earlier than first arrival, you would definitely meet yourself, which would be fatal. That's why we need to terminate the program once we arrive at the destination earlier than TIME_IN_INPUT. BTW, it SEEMS that terminating the BFS process in such a way would lead to the smallest k. |
|
|