2384: 全1序列(one)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:35 Solved:25

Description

给定一个具有 n 个数字的 0、1 序列,求连续 1 的个数为 k 的子序列个数。

Input

第一行包含整数 n , k。
第二行包含 n 个数,分别是 0、1。

Output

输出连续 1 的个数为 k 的子序列个数。

Sample Input Copy

6 2
1 1 1 0 0 1

Sample Output Copy

2

HINT

【数据范围】
1≤n≤40000

Source/Category