Editorial for CCC '18 S3 - RoboThieves
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
For of the marks available, there are no security cameras nor conveyor belts in the input. There will only be empty cells, walls and the robot's initial position. This can be solved using either BFS or DFS on the grid and storing the number of steps to get to each empty cell.
Time Complexity:
For another 5 of the 15 marks, there are no conveyor belts. Security cameras must now be taken into consideration. An array of size by can be used to keep track of which positions are under surveillance. This can be achieved by iterating up, left, down and right from the security cameras and marking positions as invalid for traversal. Don't forget that walls block the cameras' vision. BFS or DFS as before, without using invalid positions.
Time Complexity:
For full marks, both security cameras and conveyor belts must be considered. Mark invalid positions like in the second subtask. Marking conveyor belts in line of view is up to personal preference (since they can be considered separately while traversing the grid), but take care to mark the empty cells past them. Since the conveyors take no steps to traverse, the endpoint of each conveyor can be precomputed.
Time Complexity:
Comments