DWITE Online Computer Programming Contest, October 2010, Problem 5
That vacuum robot from Problem 2 did not work out that well – its breaks don't work. Luckily it safely stops whenever it hits a wall, so maybe it's not all that bad? We can use software to plan out shortest routes to bounce around from one spot to another, in a
#
– walls.
– empty spaceA
– start positionB
– end position
The input will contain 5 sets of inputs, each a
The output will contain 5 lines, each an integer of the minimum number of moves necessary to get from point
Notes: test cases will be such that it's always possible to come to a stop at point
Sample Input
....#.....
..A.......
....B#....
...#......
..........
..........
..........
..........
..........
..........
----------
....#.....
..A.......
....B#....
#..#......
..........
..........
..........
..........
..........
..........
----------
Sample Output
4
3
Problem Resource: DWITE
Comments