← All problemsSign in

Binary Grid Forces

CodeChefRating 2344Open on judge ↗

You are given a list $L$ consisting of $N$ **binary** strings, each of length $M$. You can do the following operation any (possibly zero) number of times: - Swap $2$ positions in $L_i$ if the same $2$ positions are both $1$ currently in $L_{i + 1}$. More formally, in one operation, you can: - Pick $3$ integers $i, j, k$ such that: - $1 \le i \lt N$; - $1 \le j \lt k \le M$; - $L_{(i + 1,

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