# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
294510 | 7_7_7 | Telefoni (COCI17_telefoni) | C++17 | 22 ms | 2176 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;
int d;
int main()
{
ios_base::sync_with_stdio(false);
cin >> n >> d;
vector<int> a(n);
for(auto &x: a) cin >> x;
int cur = 0, res = 0;
for(int i = 1; i < n; i ++){
if(a[i] == 1){
res += (i - cur - 1) / d;
cur = i;
}
}
cout << res << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |