# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86338 | NurstanDuisengaliev | Telefoni (COCI17_telefoni) | C++14 | 111 ms | 800 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>
#define pb push_back
using namespace std;
vector <int> x;
int main () {
int n, m;
cin >> n >> m;
bool a[n];
for (int i = 0; i < n; i ++) {
cin >> a[i];
}
int sum = 0;
int k = 0;
for (int i = 0; i < n; i ++) {
if (a[i] == 0) {
k ++;
}
else {
if (k != 0) {
x.pb(k);
}
k = 0;
}
}
if (k != 0) {
x.pb(k);
}
for (int i = 0; i < x.size(); i ++) {
sum += x[i] /m;
}
cout << sum;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |