# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521506 | huangqr | Telefoni (COCI17_telefoni) | C++14 | 20 ms | 964 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;
typedef long long ll;
typedef pair<ll,ll> pl;
const ll lim=5e5+5,mod=1e9+7;
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
ll n,d,ans=0,ctr=0;
cin>>n>>d;
while(n--){
bool x;
cin>>x;
if(x==0){
ctr++;
if(ctr>=d){
ctr=0;
ans++;
}
}
else ctr=0;
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |