Problem 2503 · Hard

Maximum Number of Points From Grid Queries

Grow the region from the top-left cell in increasing query order, using a min heap of frontier cells.

Open the interactive visualisation