← All problemsSign in

Strings

CodeChefRating 1769Open on judge ↗

Given a binary number $S$ containing only of 1's and 0's, find two binary numbers $A$ and $B$ such that the sum of the number of 1's in $A$ and $B$ is minimum and $A-B=S$. If there are many such numbers, you can print any. The binary number $S$ has some properties. See the Constraints section for details. ### Input: - The only line of input contains a single binary number $S$ without leading ze

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