Forced Particles
CodeChefOpen on judge ↗
You are given a grid with n rows and m columns. Each cell of this grid can either be empty or it contains one particle. It can never contain more than one particle. Let's denote the cell in the i-th row and j-th column by (i,j), with the top left corner being (0,0). From a cell (i,j), a particle could move in one of the following four directions: - to the left, i.e. to the cell (i,j−1) - to the
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.
Sign in to chat with the tutor and save your progress.
Sign in to start