# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75048 | charlies_moo | Telefoni (COCI17_telefoni) | C++17 | 60 ms | 672 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 <iostream>
using namespace std;
int main() {
int n, d;
cin >> n >> d;
int lt;
int c = 0;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
if (a == 1) {
lt = i;
} else if (i - lt == d) {
lt = i;
c++;
}
}
cout << c << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |