# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
32885 | Dat160601 | Telefoni (COCI17_telefoni) | C++14 | 23 ms | 4520 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;
long long n,a[300007],ans=0,d,coun=0;
int main(){
ios_base::sync_with_stdio(0);
cin>>n>>d;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++){
if(a[i]==1) coun=0;
else coun++;
if(coun==d){
coun=0;
ans++;
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |