# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82733 | heon | Telefoni (COCI17_telefoni) | C++11 | 26 ms | 2820 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(!left){
if(!v[i]) sol++;
left = d;
}
else if(v[i]) left = d;
}
cout << sol;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |