답안 #722801

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
722801 2023-04-12T22:15:38 Z vjudge1 Telefoni (COCI17_telefoni) C++17
16 / 80
13 ms 2004 KB
#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;
      }   
    }
  }

  cout << cnt << "\n";

  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 316 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Incorrect 0 ms 320 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 13 ms 2004 KB Output isn't correct
9 Incorrect 13 ms 2004 KB Output isn't correct
10 Incorrect 13 ms 2004 KB Output isn't correct