|
|
its wa is something like a Ivan's Car problem 6 12 +.+-+-+-+-+-+-+-+-+-+-+.+ | | . . . . . . . . . | | +.+.+-+-+-+-+-+-+-+-+.+.+ | | | . . . . . . . | | | +.+.+.+-+-+-+-+-+-+.+.+.+ | | | | . . . . | | . . | +.+.+.+.+.+.+.+.+.+.+-+-+ | . . | . . . . | . | . | +.+.+-+.+.+.+.+.+.+.+.+.+ | | | . . . . . | . | . | +.+.+.+.+.+.+.+.+.+.+.+.+ |1|2| . . . . . | . | . | +-+-+.+.+.+.+.+.+.+.+.+.+ According to the problem statement, right answer is 37. But the solution which returns 40 also got AC. So is the answer 40 or 37? What if one of them is outside the trap? Do they still need to keep contact (have at least one common corner)? Edited by author 20.10.2012 18:13 Yes, what's the answer for this test: 1 2 +.+-+ |1|2. +-+-+ ? UPD: i got accepted, answer for this test is 2. Too bad it doesn't clarify anything about original question, so I'll answer it: yes, they have to be in adjacent rooms even after one of them got out. Edited by author 23.10.2012 23:34 So the first one out must remain in contact with the other, but if the other can step out on the very next turn, and by stepping out they become separated, it's OK...? In my solution what you said is not allowed, but it seems like in optimal solution this situation can't happen. > In my solution what you said is not allowed Then shouldn't the answer to your example be 3 instead of 2 as your wrote? 1 up 1 right 2 right Your answer of 2 requires: 1 up 2 right But this separates them. Edited by author 25.10.2012 11:25 Yes, but there are no walls outside the given rectangle, so while executing "1 right" command you don't pass through thin wall and thus the answer isn't increased ;D Doh. Right you are. I did not read the problem statement properly. I was thinking it was "number of moves." I think yes.Because I got WA5 if no.But AC if yes. My English is very bad.Sorry. Shortest path with respect to number of crossed walls is also shortest with respect to number of moves. Edited by author 28.08.2018 21:03 3 different solutions gets WA24. Is this test correct or I don't understand the statement? Hi there, My AC code (and, I think, many others) outputs "-1" for the following test, whereas according to the problem statement right answer is "3": 1 5 +-+-+-+.+-+ | | .1|2| | +-+.+-+-+-+ It seems this problem needs more good tests. Up Edited by author 16.01.2013 18:30 Up If you have more good tests, send them to timus_support@acm.timus.ru Do you check this mailbox? Some time ago I sent new tests for 1005 to kill greedy sols - and no reaction on timus side. If you really need new tests for this problem and will add them - I can prepare. Some time ago limitations have been modified to 2 <= n, m (was 1 <= n, m). Sorry for misinformation. I think the problem could be more interesting and challenging with old limitations and new tests. Currently it is rather straightforward. It should be "Death" for your test case as they need to "always" stay close together. Even when one of them is out. You're wrong. According to the problem statement they need to stay close to each other only in order to keep moving. Here it is possible for both of them to leave the labyrinth. > You're wrong. According to the problem statement they need to stay close to each other only in order to keep moving. Your interpretation is not supported by the problem language. I agree with tvhong, the problem statement clearly says that they must stay close. If your interpretation was correct then the second sample would not be "Death." Test: 3 3 +.+-+.+ |1|2| | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+ Answer: 8 Just look( in back order ): +.+-+.+ | | | | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+ 0 0
+.+-+.+ | | | | +-+.+.+ | | . | +-+.+.+ | | |0| +-+.+.+ 0
+.+-+.+ | | | | +-+.+.+ | | . | +-+.+.+ | |0|0| +-+.+.+
+.+-+.+ | | | | +-+.+.+ | | .0| +-+.+.+ | |0| | +-+.+.+
+.+-+.+ | | | | +-+.+.+ | |0.0| +-+.+.+ | | | | +-+.+.+
+.+-+.+ | |0| | +-+.+.+ | | .0| +-+.+.+ | | | | +-+.+.+
+.+-+.+ | |0|0| +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+
0 +.+-+.+ | |0| | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+
0 +.+-+.+ | |0| | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+
0 +.+-+.+ | |0| | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+
+.+-+.+ |0|0| | +-+.+.+ | | . | +-+.+.+ | | | | +-+.+.+
All my own tests pass (and the samples of course). Any idea what is different about test 9? Why the answer is 13? 3 4 +.+-+-+-+ | . .1. | +-+-+-+.+ | .2. . | +.+.+.+-+ | . | | | +.+.+-+-+ The second may help the first to come outside through the top wall (1,2), 4 moves, then the first can help from outside the second to move through the bottom wall (7,2), 2 moves. The first may not go "up" out the top exit because according to the problem statement they must remain in rooms sharing walls/corners on every move. Может ли между двумя соседними по стороне комнатами не быть пустоты (пробел)? то есть верно ли, что каждая комната всегда окружена какими-то стенами и углами? |
|
|