Submission #211794

#TimeUsernameProblemLanguageResultExecution timeMemory
211794origami100Telefoni (COCI17_telefoni)C++11
80 / 80
72 ms888 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int pre = 0, cnt= 0; for(int i = 0; i < n; i++){ int a; cin >> a; if(a == 1) pre = 0; else pre++; if(pre >= m){ cnt++; pre = 0; } } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...