Submission #32885

#TimeUsernameProblemLanguageResultExecution timeMemory
32885Dat160601Telefoni (COCI17_telefoni)C++14
80 / 80
23 ms4520 KiB
#include <bits/stdc++.h> using namespace std; long long n,a[300007],ans=0,d,coun=0; int main(){ ios_base::sync_with_stdio(0); cin>>n>>d; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++){ if(a[i]==1) coun=0; else coun++; if(coun==d){ coun=0; ans++; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...