# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521300 | chaoyue | Telefoni (COCI17_telefoni) | C++17 | 14 ms | 844 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;
#define ll long long
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, d, x, dist=0, cnt=0;
cin>>n>>d;
for(int i=0; i<n; i++){
cin>>x;
if(x){
dist = 0;
}
else{
dist++;
if(dist >= d){
dist = 0;
cnt++;
}
}
}
cout<<cnt;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |