Submission #884397

#TimeUsernameProblemLanguageResultExecution timeMemory
884397ElenaBMTelefoni (COCI17_telefoni)C++17
80 / 80
35 ms1616 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 cont = 0, ans =0; for (int i = 0; i < n; ++i){ if (!tel[i]){ cont++; if (cont == d){ cont = 0; ans++; } } else cont = 0; } cout<< ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...