← All problemsSign in

Count Arrays

CodeChefRating 2472Open on judge ↗

Consider all matrices with $N$ rows (numbered $1$ through $N$) and $M$ columns (numbered $1$ through $M$) containing only integers between $0$ and $K-1$ (inclusive). For each such matrix $A$, let's form a sequence $L_1, L_2, \ldots, L_{N+M}$: - For each $i$ ($1 \le i \le N$), $L_i$ is the maximum of all elements in the $i$-th row of $A$. - For each $i$ ($1 \le i \le M$), $L_{N+i}$ is the maximum

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