# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1024031 | kustizus | Telefoni (COCI17_telefoni) | C++17 | 10 ms | 860 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>
#define ll long long int
using namespace std;
ll n,k,x,d,ans=0;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>k;
for (ll i=1;i<=n;i++){
cin>>x;
if (x==1) d=0;
else if (x==0) d++;
if (d==k){
d=0;
ans++;
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |