#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define S second
#define F first
#define ll long long
#define PB push_back
#define PF push_front
using namespace std;
signed main(){
ll n,d;
ll cont = 0;
cin >> n >> d;
vector<int>V;
for(ll i = 0;i < n;i++){
ll x;
cin >> x;
V.PB(x);
}
ll pos = 0;
for(pos = 0; pos < n ;pos++){
if(V[pos]==1)continue;
else{
pos += d;
cont++;
}
}
cout << cont;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
300 KB |
Output isn't correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Incorrect |
1 ms |
304 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
8 |
Incorrect |
40 ms |
2968 KB |
Output isn't correct |
9 |
Incorrect |
40 ms |
3008 KB |
Output isn't correct |
10 |
Incorrect |
43 ms |
3012 KB |
Output isn't correct |