← All problemsSign in

Ones Guessing

**This is an interactive problem.** The jury has a binary string $S$ of length $N$ consisting of the characters $\texttt{0}$ and $\texttt{1}$. It has $K \geq 1$ characters $\texttt{1}$. You need to make exactly $N$ guesses on the value of $K$. After the $i$-th guess $G_i$, you will be given $S_i$ (the $i$-th character of $S$). You win if there exists some $j$ ($1 \leq j \leq N$) such that $G_j

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