# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66521 | KLPP | Telefoni (COCI17_telefoni) | C++14 | 63 ms | 3640 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<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
int n,d;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int next=n-1;
int cnt=0;
for(int i=n-2;i>-1;i--){
if(arr[i]==1)next=i;
else{
if(next-i>=d){
cnt++;
next=i;
}
}
}cout<<cnt<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |