Codeforces div 3 650 problem c

http://codeforces.com/contest/1367/problem/C


i have coded my solution …i am just failing at the test case when the whole string is made of 0 …plz correct that part in my code …

Dont foward the link of editorial…

correct my code for this case only …when size of my vector is 1…that is string is made of 0 only initially…

reply at the earliest…

declare a variable d=0.
if the current character is zero then do d++ and if d==k+1 then ans++,d=0
else
check whether the the value of d is less than k then do ans-- and d=0

Now if all the characters of the string is 0 then only the if condition is satisfied. Hence, u can find the answer

plz make this change in my already coded solution …i would be able to understand it better…
reply at the earliest…

PLZ REPLY IT BEEN 6 DAYS ALREADY…

Pls tell me where are u facing the issue while implementingthe concept given by me.

Is that concept valid for
when size of my vector is 1…that is string is made of 0 only initially…
Or is this a whole new concept
I had asked just for this specific case so that I could use my own code

Actually you can get answer by just considering the solution which i had told. But u can take specific case from it.