# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82731 | heon | Telefoni (COCI17_telefoni) | C++11 | 35 ms | 3576 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, d;
cin >> n >> d;
vector <int> v(n);
for(int i = 0; i < n; i++) cin >> v[i];
int sol = 0, left = d - 1;
for(int i = 1; i < n; i++, left--){
if(!v[i] && left == 0){
left = d;
sol++;
}
else if(v[i] && left) left = d;
}
cout << sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |