Binary Array
CodeChefOpen on judge ↗
There is a boolean array of size $N$. A boolean array can consist of only $2$ types of values - $0$ $or$ $1$. Suppose we denote the size of the longest subdivision of successive elements in the array $A$, compromising of only $1's$, as g(a). You can not replace more than $Z$ zeroes to ones to maximize g(a). ###Input: - The first line contains two integers $N$ and $Z$— the number of elements in
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