# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
722801 | vjudge1 | Telefoni (COCI17_telefoni) | C++17 | 13 ms | 2004 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 F first
#define S second
#define ll long long
#define EB emplace_back
using namespace std;
const int SIZE = 1e5 + 1;
const int MOD = 1e9 + 7;
int main() {
ios_base::sync_with_stdio(0); cin.tie(nullptr);
int n, d; cin >> n >> d;
vector<int> M(n + 1);
for (int i = 1; i <= n; i ++) {
cin >> M[i];
}
int x = 1;
int cnt = 0;
for (int i = 1; i <= n; i ++) {
if (M[i] == 0) {
if (i - x >= d) {
M[i] = 1;
cnt ++;
x = i;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |