Submission #147820

#TimeUsernameProblemLanguageResultExecution timeMemory
147820mariadincaTelefoni (COCI17_telefoni)C++14
80 / 80
76 ms888 KiB
#include <iostream> using namespace std; int n, d, i, x, sol, dist; int main(){ cin>>n>>d; for(i=1;i<=n;i++){ cin>>x; if(x == 1) dist = 0; else dist++; if(dist == d){ sol++; dist = 0; } } cout<<sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...