Submission #153839

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