Lucky Matrix
For a fixed **binary** matrix $B$ of size $M \times N$, hErd calls a **binary** array $A$ of size $N$ *lucky* if: - $\displaystyle{\sum_{j=1}^{N} B_{(i,j)} A_{j} \equiv 0 \pmod{2}}$ for all $1 \leq i \leq M$ The matrix $B$ is constructed by setting $B_{(i,j)} \ (1 \leq i \leq M, 1 \leq j \leq N)$ as $1$ with probability $p \ (0 \lt p \leq 1)$. Note that input for $p$ is given in format $\frac{X
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