# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
891712 | ind1v | Telefoni (COCI17_telefoni) | C++11 | 13 ms | 1308 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
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
const int N = 3e5 + 4;
bool a[N];
int n, d, p, c;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> d;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
if (i == 1) {
p = i + d;
} else {
if (a[i] == 1) {
if (p < i) {
++c;
}
p = i + d;
} else {
if (p < i) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |