prithivMLmods/Coder-Stat huggingface dataset:
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;

int main() {
  ll n, k, q;
  cin >> n >> k >> q;
  ll a[n];
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }
  ll cnt[n];
  rep(i, n) cnt[i] = 0;
  rep(i, q) { cnt[a[i]]++; }
  rep(i, n) {
    cnt[i] += k - q;
    if (cnt[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

Fixed submission:
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;

int main() {
  ll n, k, q;
  cin >> n >> k >> q;
  ll a[q];
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }
  ll cnt[n];
  rep(i, n) cnt[i] = 0;
  rep(i, q) { cnt[a[i]]++; }
  rep(i, n) {
    cnt[i] += k - q;
    if (cnt[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>

using namespace std;

int main() {
  int n, k, q;
  cin >> n;
  cin >> k;
  cin >> q;

  const int MAX_MEMBER = 10000;

  // 各自の正解数を加算
  int correctCount[MAX_MEMBER] = {};
  for (int i = 0; i < q; i++) {
    int correcter;
    cin >> correcter;
    correctCount[correcter - 1] += 1;
  }

  // 減点の合計が持ち点を超えないか確認
  for (int i = 0; i < n; i++) {
    if (k > (q - correctCount[i]))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


Fixed submission:
#include <iostream>
#include <string>

using namespace std;

int main() {
  int n, k, q;
  cin >> n;
  cin >> k;
  cin >> q;

  const int MAX_MEMBER = 100000;

  // 各自の正解数を加算
  int correctCount[MAX_MEMBER] = {};
  for (int i = 0; i < q; i++) {
    int correcter;
    cin >> correcter;
    correctCount[correcter - 1] += 1;
  }

  // 減点の合計が持ち点を超えないか確認
  for (int i = 0; i < n; i++) {
    if (k > (q - correctCount[i]))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  int N;
  ll K;
  int Q;
  cin >> N >> K >> Q;
  int A[Q + 3];
  ll ten[N + 3];
  for (int i = 1; i < Q + 1; i++)
    cin >> A[i];
  for (int i = 1; i < N + 1; i++)
    ten[i] = K;
  for (int i = 1; i < Q + 1; i++) {
    ten[A[i]]++;
    for (int j = 1; j < N + 1; j++) {
      ten[j]--;
    }
  }
  for (int i = 1; i < N + 1; i++) {
    if (ten[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  int N;
  ll K;
  int Q;
  cin >> N >> K >> Q;
  int A[Q + 3];
  ll ten[N + 3];
  for (int i = 1; i < Q + 1; i++)
    cin >> A[i];
  for (int i = 1; i < N + 1; i++)
    ten[i] = K;
  for (int i = 1; i < Q + 1; i++) {
    ten[A[i]]++;
  }
  for (int j = 1; j < N + 1; j++) {
    ten[j] = ten[j] - Q;
  }
  for (int i = 1; i < N + 1; i++) {
    if (ten[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()
#define out(a) cout << (a) << endl
using namespace std;
using ll = long long;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> vec(n, k - q);
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    for (int j = 0; j < n; j++) {
      if (j == a - 1)
        vec[j]++;
    }
  }

  for (int i = 0; i < n; i++) {
    if (vec[i] > 0)
      out("Yes");
    else
      out("No");
  }
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()
#define out(a) cout << (a) << endl
using namespace std;
using ll = long long;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> vec(n, k - q);
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    vec[a - 1]++;
  }

  for (int i = 0; i < n; i++) {
    if (vec[i] > 0)
      out("Yes");
    else
      out("No");
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>

int main(void) {
  int N, K, Q, i, j;
  int A[100000];
  int B[100000];
  scanf("%d %d %d/n", &N, &K, &Q);
  for (i = 0; i <= Q - 1; i++) {
    scanf("%d/n", &A[i]);
  }
  for (j = 0; j <= N - 1; j++) {
    B[j] = 0;
    for (i = 0; i <= Q - 1; i++) {
      if (A[i] == j + 1) {
        B[j]++;
      }
    }
  }
  for (j = 0; j <= N - 1; j++) {
    if (B[j] >= Q - K + 1) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}

Fixed submission:
#include <stdio.h>

int main(void) {
  int N, K, Q, i, j;
  int A[100000];
  int B[100000];
  scanf("%d %d %d/n", &N, &K, &Q);
  for (i = 0; i <= Q - 1; i++) {
    scanf("%d/n", &A[i]);
  }
  for (i = 0; i <= N - 1; i++) {
    B[i] = 0;
  }
  for (i = 0; i <= Q - 1; i++) {
    j = A[i] - 1;
    B[j]++;
  }
  for (j = 0; j <= N - 1; j++) {
    if (B[j] >= Q - K + 1) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define P pair<int, int>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define re(i, k, n) for (int i = k; i < n; i++)
#define mod 1000000007;
// 最大公約数
int gcd(int s, int b) {
  if (b == 0)
    return s;
  return gcd(b, s % b);
}
signed main() {
  int n, k, q;
  cin >> n >> k >> q;
  int a[q], b[n];
  rep(i, q) { cin >> a[i]; }
  rep(i, n) { b[i] = k; }
  rep(i, q) {
    rep(j, n) {
      if (j + 1 == a[i]) {
        continue;
      } else {
        b[j]--;
      }
    }
  }
  rep(i, n) {
    if (b[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define P pair<int, int>
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define re(i, k, n) for (int i = k; i < n; i++)
#define mod 1000000007;
// 最大公約数
int gcd(int s, int b) {
  if (b == 0)
    return s;
  return gcd(b, s % b);
}
signed main() {
  int n, k, q;
  cin >> n >> k >> q;
  int a[q], b[n];
  rep(i, q) { cin >> a[i]; }
  rep(i, n) { b[i] = k - q; }
  rep(i, q) { b[a[i] - 1]++; }
  rep(i, n) {
    if (b[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(void) {
  int n, k, q;

  cin >> n >> k >> q;

  vector<int> a(10001), d(10001);
  vector<string> ans(n);

  rep(i, q) {
    cin >> a.at(i);
    d.at(a.at(i) - 1)++;
  }

  rep(i, n) {
    if ((k - q + d.at(i)) > 0) {
      ans.at(i) = "Yes";
    } else {
      ans.at(i) = "No";
    }
    cout << ans.at(i) << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(void) {
  int n, k, q;

  cin >> n >> k >> q;

  vector<int> a(100001), d(100001);
  vector<string> ans(n);

  rep(i, q) {
    cin >> a.at(i);
    d.at(a.at(i) - 1)++;
  }

  rep(i, n) {
    if ((k - q + d.at(i)) > 0) {
      ans.at(i) = "Yes";
    } else {
      ans.at(i) = "No";
    }
    cout << ans.at(i) << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) cin >> a[i];

  vector<int> ans(n);
  set<int> uni(a.begin(), a.end());
  for (auto itr = uni.begin(); itr != uni.end(); itr++) {
    ans[*itr - 1] = count(a.begin(), a.end(), *itr);
  }
  rep(i, n) ans[i] += k - q;
  rep(i, n) puts(ans[i] <= 0 ? "No" : "Yes");

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) cin >> a[i];

  vector<int> ans(n);
  rep(i, q) ans[a[i] - 1]++;
  rep(i, n) ans[i] += k - q;
  rep(i, n) puts(ans[i] <= 0 ? "No" : "Yes");

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  // #endif
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a, b, c, i, j, k, l, n, q;
  cin >> n >> k >> q;
  int art[n];
  for (i = 0; i < n; i++) {
    art[i] = k;
  }
  for (i = 0; i < q; i++) {
    cin >> c;
    c = c - 1;
    for (j = 0; j < n; j++) {

      if (j == c)
        continue;
      art[j] = art[j] - 1;
    }
  }
  for (i = 0; i < n; i++) {
    if (art[i] <= 0)
      cout << "No"
           << "\n";
    else
      cout << "Yes"
           << "\n";
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  // #endif
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int a, b, c, i, j, k, l, n, q;
  cin >> n >> k >> q;
  int art[n];
  for (i = 0; i < n; i++) {
    art[i] = k;
  }
  for (i = 0; i < q; i++) {
    cin >> c;
    c = c - 1;
    art[c] += 1;
  }
  for (i = 0; i < n; i++) {
    art[i] -= q;
  }
  for (i = 0; i < n; i++) {
    if (art[i] <= 0)
      cout << "No"
           << "\n";
    else
      cout << "Yes"
           << "\n";
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef string str;
int main() {
  // definition
  int N, K, Q, i, j;
  cin >> N;
  cin >> K;
  cin >> Q;
  vector<int> A(N);
  vector<int> B(N);
  // input
  for (i = 0; i < Q; ++i) {
    cin >> B[i];
  }
  for (i = 0; i < N; ++i) {
    A[i] = K - Q;
  }
  // calc
  for (i = 0; i < Q; ++i) {
    A[B[i] - 1] = A[B[i] - 1] + 1;
  }
  // output answer
  for (i = 0; i < N; ++i) {
    if (A[i] <= 0) {
      cout << "No" << '\n';
    } else {
      cout << "Yes" << '\n';
    }
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef string str;
int main() {
  // definition
  int N, K, Q, i, j;
  cin >> N >> K >> Q;
  vector<int> A(N), B(Q);
  // input
  for (i = 0; i < Q; ++i) {
    cin >> B[i];
  }
  for (i = 0; i < N; ++i) {
    A[i] = K - Q;
  }
  // calc
  for (i = 0; i < Q; ++i) {
    A[B[i] - 1] = A[B[i] - 1] + 1;
  }
  // output answer
  for (i = 0; i < N; ++i) {
    if (A[i] <= 0) {
      cout << "No" << '\n';
    } else {
      cout << "Yes" << '\n';
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int i = 0; i < n; i++)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> vec(q);
  for (int i = 0; i < n; i++)
    vec[i] = k - q;
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    vec[a - 1]++;
  }
  for (int i = 0; i < n; i++) {

    if (vec[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int i = 0; i < n; i++)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> vec(n);
  for (int i = 0; i < n; i++)
    vec[i] = k - q;
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    vec[a - 1]++;
  }
  for (int i = 0; i < n; i++) {

    if (vec[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// #define int long long

typedef vector<int> vi;
typedef pair<int, int> pi;

const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

#define pb push_back
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a)                                                              \
  cout << #a << ": ";                                                          \
  for (const auto &v : (a))                                                    \
  cout << v << endl

signed main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vi A(Q, 0);
  REP(i, Q) {
    int a;
    cin >> a;
    A[--a]++;
  }
  REP(i, N) {
    if (K - Q + A[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// #define int long long

typedef vector<int> vi;
typedef pair<int, int> pi;

const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

#define pb push_back
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a)                                                              \
  cout << #a << ": ";                                                          \
  for (const auto &v : (a))                                                    \
  cout << v << endl

signed main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vi A(N, 0);
  REP(i, Q) {
    int a;
    cin >> a;
    A[--a]++;
  }
  REP(i, N) {
    if (K - Q + A[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) cin >> a[i];
  vector<int> h(n, k);
  rep(i, q) { h[a[i]]++; }
  rep(i, q) h[i]--;
  rep(i, n) {
    if (h[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) cin >> a[i];
  vector<int> h(n, k - q);
  rep(i, q) { h[a[i] - 1]++; }
  rep(i, n) {
    if (h[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main(void) {
  int part, start, answer, i, j, member[10000] = {0}, right;
  scanf("%d %d %d", &part, &start, &answer);
  /* for (i = 0; i < part; i++) {
    member[i] = start;
  }*/
  for (i = 0; i < answer; i++) {
    scanf("%d", &right);
    member[right - 1]++;
    /*for (j = 0; j < part; j++) {
      member[j]--;
    }*/
  }
  for (i = 0; i < part; i++) {
    member[i] += start - answer;
  }
  for (i = 0; i < part; i++) {
    if (member[i] > 0)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
int main(void) {
  int part, start, answer, i, j, member[100001] = {0}, right;
  scanf("%d %d %d", &part, &start, &answer);
  /* for (i = 0; i < part; i++) {
    member[i] = start;
  }*/
  for (i = 0; i < answer; i++) {
    scanf("%d", &right);
    member[right - 1]++;
    /*for (j = 0; j < part; j++) {
      member[j]--;
    }*/
  }
  for (i = 0; i < part; i++) {
    member[i] += start - answer;
  }
  for (i = 0; i < part; i++) {
    if (member[i] > 0)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>

using namespace std;

int main() {
  int n, i, j, k, q;
  cin >> n >> k >> q;
  int a[q], s[q + 1];
  for (i = 1; i <= n; i++)
    s[i] = k - q;
  for (i = 0; i < q; i++) {
    cin >> j;
    s[j]++;
  }

  for (i = 1; i <= n; i++) {
    if (s[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

Fixed submission:
#include <iostream>

using namespace std;

int main() {
  int n, i, j, k, q;
  cin >> n >> k >> q;
  int a[q], s[n + 1];
  for (i = 1; i <= n; i++)
    s[i] = k - q;
  for (i = 0; i < q; i++) {
    cin >> j;
    s[j]++;
  }

  for (i = 1; i <= n; i++) {
    if (s[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3f;

int cnt[00000];
int main() {
  int n, K, q;
  cin >> n >> K >> q;
  rep(i, q) {
    int a;
    scanf("%d", &a);
    a--;
    cnt[a]++;
  }
  rep(i, n) {
    int d = q - cnt[i];
    if (d >= K) {
      puts("No");
    } else
      puts("Yes");
  }
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3f;

int cnt[100000];
int main() {
  int n, K, q;
  cin >> n >> K >> q;
  rep(i, q) {
    int a;
    scanf("%d", &a);
    a--;
    cnt[a]++;
  }
  rep(i, n) {
    int d = q - cnt[i];
    if (d >= K) {
      puts("No");
    } else
      puts("Yes");
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main() {
  int n;
  int k;
  int q;
  cin >> n;
  cin >> k;
  cin >> q;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n);
  REP(i, q)
  cin >> a[i];

  for (int i = 0; i < n; i++) {
    b[i] = k - q;
    c[i] = 0;
  }

  for (int i = 0; i < q; i++) {
    c[a[i] - 1] += 1;
  }

  for (int j = 0; j < n; j++) {
    b[j] = b[j] + c[j];
  }

  for (int i = 0; i < n; i++) {
    if (b[i] <= 0) {
      printf("No\n");
    } else
      printf("Yes\n");
  }
}

int main() {
  std::cout << std::fixed << std::setprecision(15);
  Main();
}

Fixed submission:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main() {
  int n;
  int k;
  int q;
  cin >> n;
  cin >> k;
  cin >> q;
  vector<int> a(q);
  vector<int> b(n);
  vector<int> c(n);
  REP(i, q)
  cin >> a[i];

  for (int i = 0; i < n; i++) {
    b[i] = k - q;
    c[i] = 0;
  }

  for (int i = 0; i < q; i++) {
    c[a[i] - 1] += 1;
  }

  for (int j = 0; j < n; j++) {
    b[j] = b[j] + c[j];
  }

  for (int i = 0; i < n; i++) {
    if (b[i] <= 0) {
      printf("No\n");
    } else
      printf("Yes\n");
  }
}

int main() {
  std::cout << std::fixed << std::setprecision(15);
  Main();
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int N, K, Q;
  int i, a[10000], j, b;
  scanf("%d %d %d", &N, &K, &Q);
  for (i = 1; i <= N; i++) {
    a[i] = 0;
  }
  for (j = 1; j <= Q; j++) {
    scanf("%d", &b);
    a[b] = a[b] + 1;
  }
  for (i = 1; i <= N; i++) {
    if (K - Q + a[i] > 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}


Fixed submission:
#include <stdio.h>
int main() {
  int N, K, Q;
  int i, a[1000000], j, b;
  scanf("%d %d %d", &N, &K, &Q);
  for (i = 1; i <= N; i++) {
    a[i] = 0;
  }
  for (j = 1; j <= Q; j++) {
    scanf("%d", &b);
    a[b] = a[b] + 1;
  }
  for (i = 1; i <= N; i++) {
    if (K - Q + a[i] > 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main(void) {
  int n, k, q;
  vector<int> a;
  vector<int> p;
  cin >> n >> k >> q;
  a.resize(q);

  rep(i, q) {
    int x;
    cin >> x;
    a[x - 1] += 1;
  }
  rep(i, n) { p.push_back(k); }
  rep(i, n) { p[i] -= (q - a[i]); }

  rep(i, n) {
    if (p[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main(void) {
  int n, k, q;
  vector<int> a;
  vector<int> p;
  cin >> n >> k >> q;
  a.resize(n);

  rep(i, q) {
    int x;
    cin >> x;
    a[x - 1] += 1;
  }
  rep(i, n) { p.push_back(k); }
  rep(i, n) { p[i] -= (q - a[i]); }

  rep(i, n) {
    if (p[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  for (int i = 0; i < a.size(); i++) {
    cin >> a.at(i);
  }

  vector<int> score(n, k - q);

  for (int i = 0; i < a.size(); i++) {
    score.at(a.at(i)) += 1;
  }

  for (int i = 0; i < score.size(); i++) {
    if (score.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  for (int i = 0; i < a.size(); i++) {
    cin >> a.at(i);
  }

  vector<int> score(n, k - q);

  for (int i = 0; i < a.size(); i++) {
    score.at(a.at(i) - 1) += 1;
  }

  for (int i = 0; i < score.size(); i++) {
    if (score.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int d[10005];
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= c; i++) {
    int x;
    cin >> x;
    d[x]++;
  }
  for (int i = 1; i <= a; i++) {
    if (b - c + d[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int d[100005];
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  memset(d, 0, sizeof(d));
  for (int i = 1; i <= c; i++) {
    int x;
    cin >> x;
    d[x]++;
  }
  for (int i = 1; i <= a; i++) {
    if (b - c + d[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  vector<int> B(N, 0);
  for (int i = 0; i < Q; i++) {
    cin >> A.at(i);
  }

  int k;
  for (int i = 0; i < Q; i++) {
    k = A.at(i);
    B.at(k)++;
  }

  for (int i = 0; i < N; i++) {
    if (B.at(i) > Q - K) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  vector<int> B(N, 0);
  for (int i = 0; i < Q; i++) {
    cin >> A.at(i);
  }

  int k;
  for (int i = 0; i < Q; i++) {
    k = A.at(i) - 1;
    B.at(k)++;
  }

  for (int i = 0; i < N; i++) {
    if (B.at(i) > Q - K) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int N, K, Q, j;
int A[10010] = {0};
int main(void) {
  cin >> N >> K >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> j;
    A[j - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (Q - K < A[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int N, K, Q, j;
int A[100010] = {0};
int main(void) {
  cin >> N >> K >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> j;
    A[j - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (Q - K < A[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
// https://atcoder.jp/contests/abc141/tasks/abc141_c
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int sum[10];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> v(Q), score(N, K);
  REP(i, Q) {
    int t;
    cin >> t;
    sum[t - 1]++;
  }
  REP(i, N) {
    if (K - Q + sum[i] > 0) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }

  return 0;
}

Fixed submission:
// https://atcoder.jp/contests/abc141/tasks/abc141_c
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int sum[100001];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> v(Q), score(N, K);
  REP(i, Q) {
    int t;
    cin >> t;
    sum[t - 1]++;
  }
  REP(i, N) {
    if (K - Q + sum[i] > 0) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <vector>
#define fastIO                                                                 \
  cout << fixed << setprecision(0), ios::sync_with_stdio(false),               \
      cin.tie(nullptr), cout.tie(nullptr);
using namespace std;
vector<int> v;
int main() {
  int n, k, q, freq[9] = {}, x, y = 0, arr[100005] = {};
  cin >> n >> k >> q;
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i < q; i++) {
    cin >> x;
    freq[x]++;
    y++;
  }

  for (int i = 1; i <= n; i++) {
    if ((freq[i] + (k - y)) > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
#include <vector>
#define fastIO                                                                 \
  cout << fixed << setprecision(0), ios::sync_with_stdio(false),               \
      cin.tie(nullptr), cout.tie(nullptr);
using namespace std;
vector<int> v;
int main() {
  int n, k, q, freq[100005] = {}, x, y = 0, arr[100005] = {};
  cin >> n >> k >> q;
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i < q; i++) {
    cin >> x;
    freq[x]++;
    y++;
  }

  for (int i = 1; i <= n; i++) {
    if ((freq[i] + (k - y)) > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q), p(n, k);
  for (int i = 0; i < q; i++)
    cin >> a[i];
  for (int i = 0; i < q; i++) {
    for (int j = 0; j < n; j++) {
      if (j == a[i] - 1)
        continue;
      else if (p[j] <= 0)
        continue;
      p[j]--;
    }
  }
  for (int i = 0; i < n; i++) {
    if (p[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}

Fixed submission:
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q), p(n, k);
  for (int i = 0; i < q; i++)
    cin >> a[i];
  for (int i = 0; i < n; i++)
    p[i] -= q;
  for (int i = 0; i < q; i++)
    p[a[i] - 1]++;
  for (int i = 0; i < n; i++) {
    if (p[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define INF INT_MAX
#define UINF UINT_MAX
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef std::pair<int, int> pii;

using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  vector<int> ten(q, 0);
  REP(i, q) {
    cin >> a[i];
    ten[a[i] - 1]++;
  }

  REP(i, n) {
    if (q - ten[i] < k)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>

#define INF INT_MAX
#define UINF UINT_MAX
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef std::pair<int, int> pii;

using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  vector<int> ten(n, 0);
  REP(i, q) {
    cin >> a[i];
    ten[a[i] - 1]++;
  }

  REP(i, n) {
    if (q - ten[i] < k)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#include <cstring>
using namespace std;
// typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
// define
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vi a(q), point(n);
  rep(i, q) cin >> a[i];
  rep(i, n) point.at(i) = k;
  rep(j, q) {
    rep(i, n) {
      if (i + 1 == a.at(j))
        point.at(i)++;
      point.at(i)--;
    }
  }
  rep(i, n) {
    if (point.at(i) > 0) {
      puts("Yes");
    } else {
      puts("No");
    }
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#include <cstring>
using namespace std;
// typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
// define
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vi a(q), point(n);
  rep(i, q) cin >> a[i];

  rep(i, n) point.at(i) = k - q;
  rep(i, q) point.at(a.at(i) - 1)++;
  rep(i, n) {
    if (point.at(i) > 0) {
      puts("Yes");
    } else {
      puts("No");
    }
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n), score(n);
  rep(i, n) score[i] = k;
  rep(i, q) {
    cin >> a[i];
    score[a[i] - 1]++;
  }
  rep(i, n) {
    if (score[i] <= q)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q), score(n);
  rep(i, n) score[i] = k;
  rep(i, q) {
    cin >> a[i];
    score[a[i] - 1]++;
  }
  rep(i, n) {
    if (score[i] <= q)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vector<int> answer_man(Q, 0);
  rep(i, Q) {
    int answer;
    cin >> answer;
    answer_man[answer - 1]++;
  }

  rep(i, N) { cout << (K - Q + answer_man[i] > 0 ? "Yes" : "No") << endl; }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vector<int> answer_man(N, 0);
  rep(i, Q) {
    int answer;
    cin >> answer;
    answer_man[answer - 1]++;
  }

  rep(i, N) { cout << (K - Q + answer_man[i] > 0 ? "Yes" : "No") << endl; }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define ll long long

const int N = 3e5 + 5, MAX = 3e7, MOD = 1e9 + 7;

using namespace std;

int n, k, q;
string a;
int main() {

  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < q; i++) {
    int x;
    scanf("%d", &x);
    x--;
    a[x]++;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] + k > q)
      printf("Yes\n");
    else
      printf("No\n");
  }
}


Fixed submission:
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define ll long long

const int N = 3e5 + 5, MAX = 3e7, MOD = 1e9 + 7;

using namespace std;

int n, k, q;
int a[N];
int main() {

  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < q; i++) {
    int x;
    scanf("%d", &x);
    x--;
    a[x]++;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] + k > q)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  vector<int> b(n, k - q);
  for (int i = 0; i < q; i++) {
    cin >> a[i];
  }
  for (int j = 0; j < q; j++) {
    b[a[j] - 1]++;
  }
  for (int i = 0; i < n; i++) {
    // cout << b[i] <<endl;
    if (b[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  vector<int> b(n, k - q);
  for (int i = 0; i < q; i++) {
    cin >> a[i];
  }
  for (int j = 0; j < q; j++) {
    b[a[j] - 1]++;
  }
  for (int i = 0; i < n; i++) {
    // cout << b[i] <<endl;
    if (b[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define speed                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)

using namespace std;
int main() {
  speed;
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> pep(q);
  vector<int> apep(n);
  fill(apep.begin(), apep.end(), k);
  for (int i = 0; i < q; i++) {
    cin >> pep[i];
  }
  for (int j = 0; j < q; j++) {
    for (int i = 0; i < apep.size(); i++) {
      apep[i]--;
    }
  }
  for (int i = 0; i < pep.size(); i++) {
    apep[pep[i] - 1]++;
  }
  for (int i = 0; i < n; i++) {
    if (apep[i] <= 0) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
}


Fixed submission:
#include <bits/stdc++.h>
#define speed                                                                  \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(NULL);                                                               \
  cout.tie(NULL)

using namespace std;
int main() {
  speed;
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> pep(q);
  vector<int> apep(n);
  fill(apep.begin(), apep.end(), k);
  for (int i = 0; i < q; i++) {
    cin >> pep[i];
  }
  for (int i = 0; i < apep.size(); i++) {
    apep[i] = k - q;
  }
  for (int i = 0; i < pep.size(); i++) {
    apep[pep[i] - 1]++;
  }
  for (int i = 0; i < n; i++) {
    if (apep[i] <= 0) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> participant(N + 1, K - Q);

  int A;
  for (int i = 0; i < Q; i++) {
    cin >> A;
    for (int j = 1; j < participant.size(); j++) {
      if (j == A)
        participant[j] += 1;
    }
  }

  for (int i = 1; i < participant.size(); i++) {
    cout << (participant[i] > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}


Fixed submission:
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> participant(N + 1, K - Q);

  int A;
  for (int i = 0; i < Q; i++) {
    cin >> A;
    participant[A] += 1;
  }

  for (int i = 1; i < participant.size(); i++) {
    cout << (participant[i] > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vector<int> A(Q);
  vector<int> P(N, K - Q);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    P[A[i] - 1]++;
  }

  for (int i = 0; i < N; i++) {
    if (P[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}

Fixed submission:
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;

  vector<int> A(Q);
  vector<int> P(N, K - Q);
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
    P[A[i] - 1]++;
  }

  for (int i = 0; i < N; i++) {
    if (P[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n, k, q;
  vector<int> p;

  cin >> n >> k >> q;

  p.resize(q);

  for (int i = 0; i < n; ++i) {
    p[i] = 0;
  }

  for (int i = 0; i < q; ++i) {
    int ai;
    cin >> ai;
    ++p[ai - 1];
  }

  for (int i = 0; i < n; ++i) {
    cout << (k - q + p[i] > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n, k, q;
  vector<int> p;

  cin >> n >> k >> q;

  p.resize(n);

  for (int i = 0; i < n; ++i) {
    p[i] = 0;
  }

  for (int i = 0; i < q; ++i) {
    int ai;
    cin >> ai;
    ++p[ai - 1];
  }

  for (int i = 0; i < n; ++i) {
    cout << (k - q + p[i] > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
  }
  vector<int> C(N);
  for (int i = 0; i < N; i++) {
    C[i] = K - Q + count(A.begin(), A.end(), i + 1);
  }
  for (int i = 0; i < N; i++) {
    if (C[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
  }
  vector<int> C(N);
  for (int i = 0; i < N; i++) {
    C[i] = K - Q;
  }
  for (int i = 0; i < Q; i++) {
    C[A[i] - 1] += 1;
  }
  for (int i = 0; i < N; i++) {
    if (C[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
// constexpr long long MOD = 998244353LL;
template <class T, class U> inline bool chmax(T &a, U b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class U> inline bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll n, k, q;
  cin >> n >> k >> q;
  int a[q];
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }

  int b[n];
  rep(i, n) b[i] = k;
  rep(i, q) {
    rep(i, n) { b[i]--; }
    b[a[i]]++;
  }

  rep(i, n) {
    if (b[i] > 0)
      cout << "Yes" << ln;
    else
      cout << "No" << ln;
  }
  return 0;
}

Fixed submission:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
// constexpr long long MOD = 998244353LL;
template <class T, class U> inline bool chmax(T &a, U b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class U> inline bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll n, k, q;
  cin >> n >> k >> q;
  int a[q];
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }

  int b[n];
  rep(i, n) b[i] = k - q;
  rep(i, q) b[a[i]]++;

  rep(i, n) {
    if (b[i] > 0)
      cout << "Yes" << ln;
    else
      cout << "No" << ln;
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;

const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;

int gcd(int a, int b) {
  if (b == 0)
    return a;

  return gcd(b, a % b);
}

int main() {

  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a(n);

  rep(i, q) cin >> a[i];

  vector<int> crt(n, 0);

  rep(i, q) { crt[a[i] - 1]++; }
  int ans = 0;
  rep(i, n) {
    if (k + crt[i] - q > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;

const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;

int gcd(int a, int b) {
  if (b == 0)
    return a;

  return gcd(b, a % b);
}

int main() {

  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a(q);

  rep(i, q) cin >> a[i];

  vector<int> crt(n, 0);

  rep(i, q) { crt[a[i] - 1]++; }
  int ans = 0;
  rep(i, n) {
    if (k + crt[i] - q > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int main() {
  int N, Q;
  long long int K;
  cin >> N >> K >> Q;
  int n[10005];
  for (int i = 0; i < N; i++) {
    n[i] = K;
  }
  for (int i = 0; i < N; i++) {
    n[i] = n[i] - Q;
  }
  for (int i = 0; i < Q; i++) {
    int t;
    cin >> t;
    n[t - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (n[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int N, Q;
  long long int K;
  cin >> N >> K >> Q;
  int n[100005];
  for (int i = 0; i < N; i++) {
    n[i] = K;
  }
  for (int i = 0; i < N; i++) {
    n[i] = n[i] - Q;
  }
  for (int i = 0; i < Q; i++) {
    int t;
    cin >> t;
    n[t - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (n[i] <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int a[100001];
int b[100001];
int n, k, q;

void solve() {
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) {
    b[i] = k - q;
  }
  for (int i = 0; i < q; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < q; i++) {
    b[a[i]] += 1;
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}

signed main() {
  while (1)
    solve();
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int a[100001];
int b[100001];
int n, k, q;

void solve() {
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) {
    b[i] = k - q;
  }
  for (int i = 0; i < q; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < q; i++) {
    b[a[i]] += 1;
  }
  for (int i = 1; i <= n; i++) {
    if (b[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}

signed main() {
  // while(1)
  solve();
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  for (int i = 0; i < q; i++)
    cin >> a[i], a[i]--;
  vector<int> b(n, 0);
  for (int i = 0; i < q; i++)
    b[a[i]]++;
  for (int i = 0; i < n; i++)
    cout << (k - q + b[i] > 0 ? "Yes" : "No") << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  for (int i = 0; i < q; i++)
    cin >> a[i], a[i]--;
  vector<int> b(n, 0);
  for (int i = 0; i < q; i++)
    b[a[i]]++;
  for (int i = 0; i < n; i++)
    cout << (k - q + b[i] > 0 ? "Yes" : "No") << endl;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }
  // 正解数
  vector<int> ac(q, 0);
  rep(i, q) { ac[a[i]]++; }

  rep(i, n) { cout << ((k - (q - ac[i])) > 0 ? "Yes" : "No") << endl; }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) {
    cin >> a[i];
    a[i]--;
  }
  // 正解数
  vector<int> ac(n, 0);
  rep(i, q) { ac[a[i]]++; }

  rep(i, n) { cout << ((k - (q - ac[i])) > 0 ? "Yes" : "No") << endl; }

  return 0;
}