ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1905. Travel in Time

Test 13
Posted by RR 20 Oct 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.
Posted by 198808xc 8 May 2013 16:26
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.