N,D=map(int,input().split())
T=list(map(int,input().split()))
b=0
n=0
for i in range(1,N):
if T[i]==0:
n+=1
else: n=0
if n==D:
T[i]==1
n=0
b+=1
print(b)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
25 ms |
3300 KB |
Output is correct |
2 |
Correct |
25 ms |
3300 KB |
Output is correct |
3 |
Correct |
26 ms |
3324 KB |
Output is correct |
4 |
Correct |
25 ms |
3300 KB |
Output is correct |
5 |
Correct |
26 ms |
3300 KB |
Output is correct |
6 |
Correct |
25 ms |
3292 KB |
Output is correct |
7 |
Correct |
26 ms |
3300 KB |
Output is correct |
8 |
Correct |
211 ms |
8912 KB |
Output is correct |
9 |
Correct |
207 ms |
8912 KB |
Output is correct |
10 |
Correct |
194 ms |
8792 KB |
Output is correct |