← All problemsSign in

Falling Rocks

You are in a magically discrete 2D world: an H * W grid containing H rows and W columns of cells. There are rocks at various positions (x, y), none of which can be at (1, 1) at the beginning, but there may be rocks in any other cell of the grid. (1, 1) refers to the bottom-left cell, and (W, H) refers to the top-right cell. The most interesting fact in this magic 2D world is that the rocks are f

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start