Submission #521893

#TimeUsernameProblemLanguageResultExecution timeMemory
521893safaricolaTelefoni (COCI17_telefoni)C++17
80 / 80
58 ms816 KiB
#include<bits/stdc++.h> using namespace std; long long n, ans, a[3000010],d,cnt; bool b; int main(){ cin>>n>>d; for(int i=0; i<n; i++){ cin>>b; if(b){ cnt=0; continue; } cnt++; if(cnt>=d){ ans++; cnt=0; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...