← All problemsSign in

Twos and Zeros

CodeChefRating 2092Open on judge ↗

Kulyash has given you a bag with $(N + M)$ balls having **distinct** colours. Among these, $N$ balls have the number $2$ printed on them and $M$ balls have the number $0$ printed on them. He defines the *score* of a **non-empty** subset $S$ of these $(N + M)$ balls as: $($sum of the balls in $S)$ $-$ $($size of $S)$. Find the count of non-empty subsets of these $(N + M)$ balls having their *s

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