# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520826 | beg | Telefoni (COCI17_telefoni) | C++17 | 38 ms | 860 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;
#define int long long
int cost = 0, n,tmp, d,c;
main(){
cin >> n >> d;
for(int i = 1; i <= n; i++){
cin >> tmp;
if(tmp == 0 && i-c >=d){
cost++;
c = i;
}
if(tmp == 1) c= i;
}
cout <<cost;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |