# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
147578 | Ruxandra985 | Telefoni (COCI17_telefoni) | C++14 | 28 ms | 1528 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>
using namespace std;
int v[300010];
int main()
{
int n,d,i,latest,add=0;
scanf ("%d%d",&n,&d);
for (i=1;i<=n;i++)
scanf ("%d",&v[i]);
latest = 1;
for (i=2;i<=n;i++){
if ( i - latest == d ){
if (!v[i]){
add++;
latest = i;
}
}
if (v[i])
latest = i;
}
printf ("%d",add);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |