Milling Machines
Jump to navigation
Jump to search
This problem gives us a set (10k) of differently sized X by Y grids, and a pattern of (10k) steps of removing various parts of them and asks us to output the final size of each. If we take the naive approach and apply each pattern to each grid, we have 10^8 steps, each of which requires 10^2 (100) updates. This is too slow. Instead, we can realize that we can combine all the steps into one final output (All that matters is the FURTHEST we drill in each of the 100 X coordinates), and then apply that to each of the 10k grids. This is 10^6 and is plenty fast.