Submission #884401

#TimeUsernameProblemLanguageResultExecution timeMemory
884401gutzzyTelefoni (COCI17_telefoni)C++14
80 / 80
35 ms1592 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,d; cin >> n >> d; vector<int> tel(n); for(int i=0;i<n;i++){ cin >> tel[i]; } int ans = 0; int space = 0; for (int i=0;i<n;i++){ if(tel[i]==1) space = 0; else{ space++; if(space==d){ ans++; space = 0; } } } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...