Submission #521300

#TimeUsernameProblemLanguageResultExecution timeMemory
521300chaoyueTelefoni (COCI17_telefoni)C++17
80 / 80
14 ms844 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n, d, x, dist=0, cnt=0; cin>>n>>d; for(int i=0; i<n; i++){ cin>>x; if(x){ dist = 0; } else{ dist++; if(dist >= d){ dist = 0; cnt++; } } } cout<<cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...