Submission #82733

#TimeUsernameProblemLanguageResultExecution timeMemory
82733heonTelefoni (COCI17_telefoni)C++11
80 / 80
26 ms2820 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n, d; cin >> n >> d; vector <int> v(n); for(int i = 0; i < n; i++) cin >> v[i]; int sol = 0, left = d - 1; for(int i = 1; i < n; i++, left--){ if(!left){ if(!v[i]) sol++; left = d; } else if(v[i]) left = d; } cout << sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...