#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define S second
#define F first
#define PF push_front
using namespace std;
/*
7
3 5 1 6 2 14 10
*/
int main()
{
//freopen("div7.in", "r" , stdin);
//freopen("div7.out", "w" , stdout);
int n, m;
cin >> n >> m;
vector<int>V;
for(int i = 0; i < n; i++){
int x;
cin >> x;
V.PB(x);
}
ll cnt=0;
for(int i = 0; i < n; i++){
if(V[i] == 1){
continue;
}
else{
i+=m;
cnt++;
}
}
cout << cnt;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
604 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
35 ms |
3016 KB |
Output isn't correct |
9 |
Incorrect |
34 ms |
3016 KB |
Output isn't correct |
10 |
Incorrect |
35 ms |
3016 KB |
Output isn't correct |