Gridland Metro

  • + 7 comments

    Some hints:

    1. The grid can be very large (1e18)

    1a. Make sure your code can correctly represent such a large number

    1b. You won't have enough time to do anything for each cell in the grid (even if you spent 1 nanosecond per cell, 1e18 cells would take 30 years).

    2. Don't miss the very important note: "A train track may overlap other train tracks within the same row." Consider how this problem might be solved if that weren't true (it would be very easy), and how it changes because of that statement.