Problem 3275 · Medium

K-th Nearest Obstacle Queries

Track the k smallest distances from the origin with a max-heap, so each new obstacle costs log k.

Open the interactive visualisation