← All problemsSign in

Create Binary String

CodeChefRating 1374Open on judge ↗

You want to make a binary string $S$ of length $N$. You will be paid according to the following rules: - For each occurrence of the subsequence $0$ in $S$, you are paid $A$ coins. - For each occurrence of the subsequence $1$ in $S$, you are paid $B$ coins. - For each occurrence of the subsequence $01$ in $S$, you are paid $C$ coins. - For each occurrence of the subsequence $10$ in $S$, you are pa

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