# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151307 | Linca_Robert | Telefoni (COCI17_telefoni) | C++14 | 79 ms | 1016 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int N, x, last, ans, D;
int main(){
cin >> N >> D >> x;
last = 1;
for( int i = 2; i <= N; i++ ){
cin >> x;
if( x == 1 ){
if( i - last > D ){
ans += (i - last) / D;
if( (i - last) % D == 0 )
ans--;
}
last = i;
}
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |