← All problemsSign in

E - Largest K

You have $N$ $0$'s and $N$ $1$'s with you. You want to construct a set of non-empty binary strings (say of size $K$) satisfying the following conditions: - All the $K$ strings are distinct. - The total number of $0$'s in all strings is $\le N$. - The total number of $1$'s in all strings is $\le N$. Find the maximum $K$ for which a valid set of strings exist. ### Input - The first line of input

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