Submission #147582

#TimeUsernameProblemLanguageResultExecution timeMemory
147582AlexPascu007Telefoni (COCI17_telefoni)C++98
80 / 80
77 ms392 KiB
#include <iostream> using namespace std; int n,d,x,dist,i,sol; 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...