# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75824 | charlies_moo | Telefoni (COCI17_telefoni) | C++98 | 66 ms | 3512 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 <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n,d,ans=0;
int a[300001];
int main()
{
cin>>n>>d;
for(int i=1;i<=n;i++)
cin>>a[i];
int v=1;
for(int i=1;i<=n;i++)
{
if(a[i])
v=i;
else if(v+d==i)
{
v=i;
ans++;
}
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |