C - Recover Array
CodeChefOpen on judge ↗
There is an array $A$ of length $10^5$, consisting of zeroes and ones. You can ask queries about subarray sums. On a query $1 \leq l \leq r \leq 10^5$, you get the sum $A_l + A_{l + 1} + \ldots + A_r$. You can ask a maximum of $90000$ queries. Find the array $A$. ### Note: Don't forget to flush the standard output after printing each line. It can be done using fflush(stdout) in C/C++, System
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.
Sign in to chat with the tutor and save your progress.
Sign in to start