prithivMLmods/Coder-Stat huggingface dataset:
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++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;

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

  vector<ll> A(N);
  rep(i, Q) {
    cin >> A[i];
    A[i]--;
  }

  vector<ll> point(N);
  point.assign(N, K - Q);

  rep(i, Q) { point[A[i]]++; }

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

  return 0;
}

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

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

  vector<ll> A(Q);
  rep(i, Q) {
    cin >> A[i];
    A[i]--;
  }

  vector<ll> point(N);
  point.assign(N, K - Q);

  rep(i, Q) { point[A[i]]++; }

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

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
ll cor[10500];
int main() {
  ll n, k, q;
  cin >> n >> k >> q;
  ll a[q];
  for (int i = 0; i < q; i++) {
    int x;
    cin >> x;
    cor[x - 1] += 1;
  }

  for (int i = 0; i < n; i++) {
    if (k - q + cor[i] <= 0) {
      cout << "No";
    } else
      cout << "Yes";
    cout << '\n';
  }
}

Fixed submission:
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
ll cor[105000];
int main() {
  ll n, k, q;
  cin >> n >> k >> q;
  ll a[q];
  for (int i = 0; i < q; i++) {
    int x;
    cin >> x;
    cor[x - 1] += 1;
  }

  for (int i = 0; i < n; i++) {
    if (k - q + cor[i] <= 0) {
      cout << "No";
    } else
      cout << "Yes";
    cout << '\n';
  }
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#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];
  vector<int> score(N);
  rep(i, N) score[i] = K;
  rep(i, Q) rep(j, N) {
    if (j != A[i] - 1)
      --score[j];
  }
  rep(i, N) {
    if (score[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;
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];
  vector<int> score(N);
  rep(i, N) score[i] = K - Q; // 初期値を工夫するのがこの問題のポイント
  rep(i, Q)++ score[A[i] - 1];
  rep(i, N) {
    if (score[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << 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 < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

int dp[100];

// 最大公約数
int gcd(int x, int y) {
  if (x % y == 0)
    return 1;
  return gcd(y, x % y);
}
// 最小公倍数
int lcm(int x, int y) { return x * y / gcd(x, y); }
// フィボナッチ数列
// 配列dpを-1で初期化する
int fib(int n) {
  if (n == 0 || n == 1)
    return dp[n] = 1;
  if (dp[n] != -1)
    return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
// 階乗計算(factorial)
int fact(int n) {
  if (n = 1)
    return 1;
  return n * fact(n - 1);
}
// 累乗計算(Exponentiation)
// x**y
ll expo(int x, int y) {
  ll ans = 1;
  rep(i, y) { ans *= x; }
  return ans;
}
// 桁数
int keta(ll x) {
  if (x == 0)
    return 1;
  int res = 0;
  while (x) {
    x /= 10;
    res++;
  }
  return res;
}

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  int N[10005];

  rep(i, n) { N[i] = q; }

  rep(i, q) {
    int a;
    cin >> a;
    N[a - 1]--;
  }

  rep(i, n) {
    if (N[i] < k)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

/*





















*/


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

int dp[100];

// 最大公約数
int gcd(int x, int y) {
  if (x % y == 0)
    return 1;
  return gcd(y, x % y);
}
// 最小公倍数
int lcm(int x, int y) { return x * y / gcd(x, y); }
// フィボナッチ数列
// 配列dpを-1で初期化する
int fib(int n) {
  if (n == 0 || n == 1)
    return dp[n] = 1;
  if (dp[n] != -1)
    return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
// 階乗計算(factorial)
int fact(int n) {
  if (n = 1)
    return 1;
  return n * fact(n - 1);
}
// 累乗計算(Exponentiation)
// x**y
ll expo(int x, int y) {
  ll ans = 1;
  rep(i, y) { ans *= x; }
  return ans;
}
// 桁数
int keta(ll x) {
  if (x == 0)
    return 1;
  int res = 0;
  while (x) {
    x /= 10;
    res++;
  }
  return res;
}

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  int N[100005];

  rep(i, n) { N[i] = q; }

  rep(i, q) {
    int a;
    cin >> a;
    N[a - 1]--;
  }

  rep(i, n) {
    if (N[i] < k)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

/*





















*/
Problem p02911 (C++)

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

using namespace std;

int main(void) {
  int n, point, times;
  cin >> n >> point >> times;
  vector<int> member(n, point - times);
  int crct;
  for (int i = 0; i < times; i++) {
    cin >> crct;
    for (int j = 0; j < n; j++) {
      if (j == (crct - 1)) {
        member.at(j)++;
      }
    }
  }

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

  return 0;
}

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

using namespace std;

int main(void) {
  int n, point, times;
  cin >> n >> point >> times;
  vector<int> member(n, point - times);
  int crct;
  for (int i = 0; i < times; i++) {
    cin >> crct;
    member.at(crct - 1)++;
  }

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

  return 0;
}
Problem p02911 (C++)

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

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

  int A[100001];
  rep(i, Q) { cin >> A[i]; }

  int B[100001];
  rep(i, N) { B[i] = K; }
  rep(i, Q) {
    rep(j, N) {
      if (j != A[i] - 1)
        B[j]--;
    }
  }

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


Fixed submission:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

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

  int A[100001];
  rep(i, Q) { cin >> A[i]; }

  int B[100001];
  rep(i, N) { B[i] = K; }

  int M = max(N, Q);
  rep(i, M) {
    B[i] -= Q;
    B[A[i] - 1]++;
  }

  rep(i, N) {
    if (B[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (C++)

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

int main() {
  int N, K, Q, tmp;
  cin >> N >> K >> Q;
  vector<int> a(Q, 0);
  vector<int> m(N, K);

  for (int i = 0; i < Q; i++) {
    cin >> tmp;
    tmp--;
    a[tmp]++;
  }

  for (int i = 0; i < N; i++) {
    tmp = Q - a[i];
    m[i] -= tmp;
  }

  for (int i = 0; i < N; i++) {
    cout << (m[i] > 0 ? "Yes" : "No") << endl;
  }
}


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

int main() {
  int N, K, Q, tmp;
  cin >> N >> K >> Q;
  vector<int> a(N, 0);
  vector<int> m(N, K);

  for (int i = 0; i < Q; i++) {
    cin >> tmp;
    tmp--;
    a[tmp]++;
  }

  for (int i = 0; i < N; i++) {
    tmp = Q - a[i];
    m[i] -= tmp;
  }

  for (int i = 0; i < N; i++) {
    cout << (m[i] > 0 ? "Yes" : "No") << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

Fixed submission:
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main(void) {
  long N, K, Q;
  cin >> N >> K >> Q;
  vector<long> A(Q);
  for (long i = 0; i < Q; i++) {
    cin >> A[i];
  }
  vector<long> score(N);
  for (long i = 0; i < N; i++) {
    score[i] = 0;
  }
  for (long i = 0; i < Q; i++) {
    score[A[i] - 1]++;
  }
  for (long i = 0; i < N; i++) {
    if (K - Q + score[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 < (int)(n); i++)
#define reps(i, n) for (int i = 1; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)-1); i > 0; i--)
#define ALL(x) (X).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long;
using p = pair<int, int>;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> point(N, K - Q);

  vector<int> a(N);
  rep(i, Q) {
    cin >> a[i];
    a[i]--;
  }
  rep(i, Q) { point.at(a[i])++; }
  rep(i, N) {
    if (point[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 < (int)(n); i++)
#define reps(i, n) for (int i = 1; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)-1); i > 0; i--)
#define ALL(x) (X).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using lint = long long;
using p = pair<int, int>;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> point(N, K - Q);

  vector<int> a(Q);
  rep(i, Q) {
    cin >> a[i];
    a[i]--;
  }
  rep(i, Q) { point.at(a[i])++; }
  rep(i, N) {
    if (point[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << 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;
  int A[N];
  int index;
  for (int i = 0; i < Q; i++) {
    A[i] = 0;
  }
  for (int i = 0; i < Q; i++) {
    cin >> index;
    A[index - 1] += 1;
  }

  for (int i = 0; i < N; i++) {
    if (K - (Q - A[i]) > 0)
      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;
  int A[N];
  int index;
  for (int i = 0; i < N; i++) {
    A[i] = 0;
  }
  for (int i = 0; i < Q; i++) {
    cin >> index;
    A[index - 1] += 1;
  }

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

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

using namespace std;
using ll = long long;
int main() {
  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a;
  for (int i = 0; i < q; i++) {
    int val;
    cin >> val;
    a.push_back(val);
  }

  vector<ll> pt(n);
  fill(pt.begin(), pt.end(), k - q);

  for (auto &e : a) {
    pt.at(e)++;
  }

  for (const auto &e : pt) {
    cout << (e > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}


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

using namespace std;
using ll = long long;
int main() {
  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a;
  for (int i = 0; i < q; i++) {
    int val;
    cin >> val;
    a.push_back(val);
  }

  vector<ll> pt(n);
  fill(pt.begin(), pt.end(), k - q);

  for (auto &e : a) {
    pt.at(e - 1)++;
  }

  for (const auto &e : pt) {
    cout << (e > 0 ? "Yes" : "No") << endl;
  }

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;
using ll = long long int;

int main(void) {
  ll n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n);
  rep(i, q) cin >> a[i];
  vector<int> p(n, k - q);
  rep(i, q) p[a[i] - 1]++;
  rep(i, n) { p[i] > 0 ? cout << "Yes" << endl : cout << "No" << endl; }
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;
using ll = long long int;

int main(void) {
  ll n, k, q;
  cin >> n >> k >> q;
  vector<int> a(q);
  rep(i, q) cin >> a[i];
  vector<int> p(n, k - q);
  rep(i, q) p[a[i] - 1]++;
  rep(i, n) { p[i] > 0 ? cout << "Yes" << endl : cout << "No" << endl; }
}
Problem p02911 (C++)

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

int main() {
  long long n, k, q, a;
  cin >> n >> k >> q;
  vector<long long> count(n, k);
  for (int i = 0; i < q; ++i) {
    cin >> a;
    count.at(a - 1) += 1;
    for (int j = 0; j < n; ++j) {
      count.at(j) -= 1;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (count.at(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, a;
  cin >> n >> k >> q;
  vector<long long> count(n, k);
  for (int i = 0; i < q; ++i) {
    cin >> a;
    count.at(a - 1) += 1;
  }
  for (int j = 0; j < n; ++j) {
    count.at(j) -= 1 * q;
  }
  for (int i = 0; i < n; ++i) {
    if (count.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A;
  for (ll i = 0; i < Q; ++i) {
    ll a;
    cin >> a;
    A[a - 1]++;
  }
  for (ll i = 0; i < N; ++i) {
    if (K - (Q - A[i]) > 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(N, 0);
  for (ll i = 0; i < Q; ++i) {
    ll a;
    cin >> a;
    A[a - 1]++;
  }
  for (ll i = 0; 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 <iostream>
#include <vector>

using namespace std;

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

  cin >> n >> k >> q;

  vector<int> player(k, 0);

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

  for (int i = 0; i < n; i++) {
    if (0 < player[i] + k - q) {
      cout << "Yes" << endl;
    } else {
      cout << "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> player(n, 0);

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

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

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define vint vector<int>
#define rep(x, y) for (int i = x; i < y; i++)
#define REP(x, y) for (int j = x; j < y; j++)
#define all(x) x.begin(), x.end()
#define pb() push_back()
#define mod 100000007
#define elif else if
#define str string
// main
signed main() {
  int N, M, O, Q, count = 0, count2 = 0, count3 = 0;
  double D = 0;
  int c = 'A' - 'a';
  // char C;
  str S, T;
  cin >> N >> M >> O;
  vint A(O);
  vint P(N);
  rep(0, N) P[i] = M;
  rep(0, O) cin >> A[i];
  rep(0, O) {
    REP(0, N) {
      if (j + 1 != A[i]) {
        P[j] -= 1;
      }
    }
  }
  rep(0, N) P[i] > 0 ? cout << "Yes" << endl : cout << "No" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define vint vector<int>
#define rep(x, y) for (int i = x; i < y; i++)
#define REP(x, y) for (int j = x; j < y; j++)
#define all(x) x.begin(), x.end()
#define pb() push_back()
#define mod 100000007
#define elif else if
#define str string
// main
signed main() {
  int N, M, O, Q, count = 0, count2 = 0, count3 = 0;
  double D = 0;
  int c = 'A' - 'a';
  // char C;
  str S, T;
  cin >> N >> M >> O;
  vint A(O);
  vint P(N);
  rep(0, N) P[i] = M;
  rep(0, O) cin >> A[i];
  rep(0, O) P[A[i] - 1] += 1;
  rep(0, N) P[i] > O ? cout << "Yes" << endl : cout << "No" << endl;
}
Problem p02911 (C++)

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

int main() {
  int N, K, Q, i, j = 0;
  cin >> N >> K >> Q;
  vector<int> P(N, K - Q);
  vector<int> Ans(Q);
  for (i = 0; i < Q; i++)
    cin >> Ans.at(i);

  for (i = 0; i < Q; i++)
    P.at(Ans.at(i))++;

  for (i = 0; i < N; i++) {
    if (P.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}

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

int main() {
  int N, K, Q, i, j = 0;
  cin >> N >> K >> Q;
  vector<int> P(N, K - Q);
  vector<int> Ans(Q);
  for (i = 0; i < Q; i++)
    cin >> Ans.at(i);

  for (i = 0; i < Q; i++)
    P.at(Ans.at(i) - 1)++;

  for (i = 0; i < N; i++) {
    if (P.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 main() {
  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a(n + 1);
  for (int i = 1; i <= q; i++) {
    cin >> a[i];
  }

  vector<int> times(n + 1, 0);
  for (int i = 1; i <= q; i++) {
    times[a[i]] += 1;
  }

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

  return 0;
}

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

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

  vector<int> a(q + 1);
  for (int i = 1; i <= q; i++) {
    cin >> a[i];
  }

  vector<int> times(n + 1, 0);
  for (int i = 1; i <= q; i++) {
    times[a[i]] += 1;
  }

  for (int i = 1; i <= n; i++) {
    if (k - (q - times[i]) > 0)
      cout << "Yes" << endl;
    if (k - (q - times[i]) <= 0)
      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++)
#define sz(x) int(x.size())
using namespace std;

int main() {
  int n, k, q;
  int point[10005];

  cin >> n >> k >> q;

  rep(i, n + 1) point[i] = 0;

  rep(i, q) {
    int temp;
    cin >> temp;
    point[temp + 1]++;
  }

  for (int i = 1; i < n + 1; i++) {
    cout << (k - (q - point[i + 1]) > 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;

int main() {
  int n, k, q;
  int point[100005];

  cin >> n >> k >> q;

  rep(i, n + 1) point[i] = 0;

  rep(i, q) {
    int temp;
    cin >> temp;
    point[temp + 1]++;
  }

  for (int i = 1; i < n + 1; i++) {
    cout << (k - (q - point[i + 1]) > 0 ? "Yes" : "No") << 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 < n; i++)
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
#define ll long long int
using namespace std;

int main() {
  int n, p, q;
  cin >> n >> p >> q;
  int qq[q];
  rep(i, q) cin >> qq[i];
  rep(i, q) qq[i]--;
  int a[n];
  rep(i, n) a[i] = p;
  rep(i, q) rep(j, n) if (j != qq[i]) a[j]--;
  rep(i, n) {
    if (a[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++)
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
#define ll long long int
using namespace std;

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

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;
int p[10005], a[10005];
int main() {
  int n, k, q;
  cin >> n >> k >> q;

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

  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;
int p[100005], a[100005];
int main() {
  int n, k, q;
  cin >> n >> k >> q;

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

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) { cout << x << endl; }
void P(long x) { cout << x << endl; }
void P(double x) { cout << x << endl; }
void P(ll x) { cout << x << endl; }
void P(string x) { cout << x << endl; }
void P(char x) { cout << x << endl; }

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

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

  rep(i, n) {
    if (k - (q - a[i]) > 0)
      Yes;
    else
      No;
  }

  return 0;
}


Fixed submission:
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) { cout << x << endl; }
void P(long x) { cout << x << endl; }
void P(double x) { cout << x << endl; }
void P(ll x) { cout << x << endl; }
void P(string x) { cout << x << endl; }
void P(char x) { cout << x << endl; }

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

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

  rep(i, n) {
    if (k - (q - a[i]) > 0)
      Yes;
    else
      No;
  }

  return 0;
}
Problem p02911 (C++)

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

using namespace std;

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

int main(void) {
  int N, K, Q;

  scanf("%d %d %d", &N, &K, &Q);
  vector<int> A(Q);
  rep(i, Q) { scanf("%d", &A[i]); }

  vector<int> score(N);
  rep(i, N) score[i] = K - Q;
  rep(i, Q) {
    rep(j, N) {
      if (j + 1 == A[i]) {
        score[j]++;
        break;
      }
    }
  }

  rep(i, N) {
    if (score[i] <= 0)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
#include <vector>

using namespace std;

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

int main(void) {
  int N, K, Q;

  scanf("%d %d %d", &N, &K, &Q);
  vector<int> A(Q);
  rep(i, Q) { scanf("%d", &A[i]); }

  vector<int> score(N);
  rep(i, N) score[i] = K - Q;
  rep(i, Q) { score[A[i] - 1]++; }

  rep(i, N) {
    if (score[i] <= 0)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
Problem p02911 (C++)

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

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  long long n, m, k, score[100005], t;
  while (cin >> n >> m >> k) {
    for (int i = 1; i <= n; i++)
      score[i] = m;
    for (int i = 1; i <= k; i++)
      cin >> t, score[t]++;
    for (int i = 1; i <= n; i++) {
      score[i] -= k;
      if (score[i] > 0)
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
}
Problem p02911 (Python)

Buggy submission (status: Time Limit Exceeded):
def main():
    N, K, Q, *A = map(int, open(0).read().split())
    A = [K + A.count(i) for i in range(1, N + 1)]
    print("\n".join(["Yes" if Q < a else "No" for a in A]))
    return


main()


Fixed submission:
def main():
    N, K, Q, *A = map(int, open(0).read().split())
    ans = [0] * N
    for a in A:
        ans[a - 1] += 1
    print("\n".join(["Yes" if Q < K + a else "No" for a in ans]))
    return


main()
Problem p02911 (Python)

Buggy submission (status: Runtime Error):
n, k, q = map(int, input().split())
a = []
for i in range(q):
    a[i] = int(input()) - 1
score = [0 for _ in range(n)]

for a_i in a:
    score[a_i] += 1

for i in range(n):
    result = k - q + score[i]
    print("Yes" if result > 0 else "No")


Fixed submission:
n, k, q = map(int, input().split())
a = []
for i in range(q):
    a.append(int(input()) - 1)
score = [0 for _ in range(n)]

for a_i in a:
    score[a_i] += 1

for i in range(n):
    result = k - q + score[i]
    print("Yes" if result > 0 else "No")
Problem p02911 (Python)

Buggy submission (status: Time Limit Exceeded):
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

points = [K for _ in range(N)]

for i in range(Q):
    points[A[i] - 1] += 1
    for j in range(N):
        points[j] -= 1

for j in range(N):
    if points[j] >= 1:
        print("Yes")
    else:
        print("No")


Fixed submission:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

points = [K for _ in range(N)]

for i in range(Q):
    points[A[i] - 1] += 1

for j in range(N):
    points[j] -= Q

for j in range(N):
    if points[j] >= 1:
        print("Yes")
    else:
        print("No")
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> cnt(N);
  for (int i = 0; i < N; i++) {
    cnt[i] = K - Q;
  }
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
    cnt[A[i] - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (A[i] > 0) {
      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> cnt(N);
  for (int i = 0; i < N; i++) {
    cnt[i] = K - Q;
  }
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
    cnt[A[i] - 1]++;
  }
  for (int i = 0; i < N; i++) {
    if (cnt[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>

int main() {
  int N, K, Q;
  int i;
  int tmp;
  static int array[10000];

  scanf("%d %d %d", &N, &K, &Q);

  for (i = 0; i < N; i++) {
    array[i] = K - Q;
  }

  for (i = 0; i < Q; i++) {
    scanf("%d", &tmp);
    array[tmp - 1]++;
  }

  for (i = 0; i < N; i++) {

    if (array[i] <= 0) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
  return 0;
}

Fixed submission:
#include <stdio.h>

int main() {
  int N, K, Q;
  int i;
  int tmp;
  static int array[100000];

  scanf("%d %d %d", &N, &K, &Q);

  for (i = 0; i < N; i++) {
    array[i] = K - Q;
  }

  for (i = 0; i < Q; i++) {
    scanf("%d", &tmp);
    array[tmp - 1]++;
  }

  for (i = 0; i < N; i++) {

    if (array[i] <= 0) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <string>
using namespace std;

int main() {
  long N, K, Q, B[10500] = {0}, A[10500];
  cin >> N >> K >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
  }

  if (Q < K) {
    for (int i = 0; i < N; i++) {
      cout << "Yes" << endl;
    }
  } else {
    for (int i = 0; i < Q; i++) {
      B[A[i]]++;
    }
    for (int i = 0; i < N; i++) {
      if (B[i + 1] <= Q - K) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}

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

int main() {
  long N, K, Q, B[100500] = {0}, A[100500] = {0};
  cin >> N >> K >> Q;
  for (int i = 0; i < Q; i++) {
    cin >> A[i];
  }

  if (Q < K) {
    for (int i = 0; i < N; i++) {
      cout << "Yes" << endl;
    }
  } else {
    for (int i = 0; i < Q; i++) {
      B[A[i]]++;
    }
    for (int i = 0; i < N; i++) {
      if (B[i + 1] <= Q - K) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

const long INF = (1l << 30);
const long LINF = (1l << 60);

long n, k, q;
long pnt[10005];

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


Fixed submission:
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

const long INF = (1l << 30);
const long LINF = (1l << 60);

long n, k, q;
long pnt[100005];

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

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

using namespace std;

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


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

using namespace std;

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

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define all(a) a.begin(), a.end()
#define P pair<long long, long long>
#define double long double
using namespace std;
// 桁
int kt(int a) {
  double b = a;
  b = log10(b);
  int c = b;
  return c + 1;
}
int lcm(int a, int b) {
  int d = a, e = b, f;
  if (a < b)
    swap(a, b);
  int c, m = 1;
  while (m) {
    c = a % b;
    if (c == 0) {
      f = b;
      m--;
    } else {
      a = b;
      b = c;
    }
  }
  return d * e / f;
}
int gcm(int a, int b) {
  int d = a, e = b, f;
  if (a < b)
    swap(a, b);
  int c, m = 1;
  while (m) {
    c = a % b;
    if (c == 0) {
      f = b;
      m--;
    } else {
      a = b;
      b = c;
    }
  }
  return f;
}
signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> d(c);
  rep(i, c) cin >> d.at(i);
  vector<int> e(a, b - c);
  rep(i, c) { e.at(d.at(i))++; }
  rep(i, a) {
    if (e.at(i) > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
#define all(a) a.begin(), a.end()
#define P pair<long long, long long>
#define double long double
using namespace std;
// 桁
int kt(int a) {
  double b = a;
  b = log10(b);
  int c = b;
  return c + 1;
}
int lcm(int a, int b) {
  int d = a, e = b, f;
  if (a < b)
    swap(a, b);
  int c, m = 1;
  while (m) {
    c = a % b;
    if (c == 0) {
      f = b;
      m--;
    } else {
      a = b;
      b = c;
    }
  }
  return d * e / f;
}
int gcm(int a, int b) {
  int d = a, e = b, f;
  if (a < b)
    swap(a, b);
  int c, m = 1;
  while (m) {
    c = a % b;
    if (c == 0) {
      f = b;
      m--;
    } else {
      a = b;
      b = c;
    }
  }
  return f;
}
signed main() {
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> d(c);
  rep(i, c) cin >> d.at(i);
  vector<int> e(a, b - c);
  rep(i, c) { e.at(d.at(i) - 1)++; }
  rep(i, a) {
    if (e.at(i) > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (C++)

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

int main(void) {

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

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

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

  return 0;
}


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

int main(void) {

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

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

  for (int i = 0; i < n; i++) {
    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;
int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  for (int i = 0; i < Q; i++) {
    int x;
    cin >> x;
    A.at(x - 1)++;
  }
  for (int i = 0; i < N; i++) {
    string S = Q - A.at(i) < K ? "Yes" : "No";
    cout << S << endl;
  }
}


Fixed submission:
#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++) {
    int x;
    cin >> x;
    A.at(x - 1)++;
  }
  for (int i = 0; i < N; i++) {
    string S = Q - A.at(i) < K ? "Yes" : "No";
    cout << S << endl;
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define pow(x) x *x

int main() {

  int N, Q, i, j;
  long long K;
  int who, A[10010] = {0};
  int border;

  cin >> N >> K >> Q;
  REP(i, Q) {
    cin >> who;
    A[--who]++;
  }

  border = Q - K;
  REP(i, N) {
    if (A[i] > border) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

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

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define pow(x) x *x

int main() {

  int N, Q, i, j;
  long long K;
  int who, A[100100] = {0};
  long long border;

  cin >> N >> K >> Q;
  REP(i, Q) {
    cin >> who;
    A[--who]++;
  }

  border = Q - K;
  REP(i, N) {
    if (A[i] > border) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#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);
  vector<int> player(N);
  rep(i, Q) { cin >> A.at(i); }
  rep(i, N) { player.at(i) = K; }
  rep(j, N) {
    rep(i, Q) {
      if (A.at(i) - 1 == j) {
      } else {
        player.at(j)--;
      }
    }
  }
  rep(i, N) {
    if (player.at(i) <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << 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() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  vector<int> player(N);
  rep(i, Q) { cin >> A.at(i); }
  rep(i, N) { player.at(i) = K - Q; }
  rep(i, Q) { player.at(A.at(i) - 1)++; }
  rep(i, N) {
    if (player.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 main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n, 0);
  int x;
  for (int i = 0; i < q; i++) {
    cin >> x;
    x--;
    a[x]++;
  }
  int sum = accumulate(a.begin(), a.end(), 0);
  for (int i = 0; i < q; i++) {
    cout << ((sum - a[i] < k) ? "Yes" : "No") << '\n';
  }
  return 0;
}


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

using namespace std;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n, 0);
  int x;
  for (int i = 0; i < q; i++) {
    cin >> x;
    x--;
    a[x]++;
  }
  for (int i = 0; i < n; i++) {
    cout << ((q - a[i] < k) ? "Yes" : "No") << '\n';
  }
  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 < (int)(n); i++)
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  rep(i, Q) {
    int x;
    cin >> x;
    --x;
    A[i] = x;
  }
  vector<int> point(N, K - Q);
  rep(i, Q) { point[A[i]]++; }
  rep(i, Q) {
    if (point[i] > 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


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

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(Q);
  rep(i, Q) {
    int x;
    cin >> x;
    --x;
    A[i] = x;
  }
  vector<int> point(N, K - Q);
  rep(i, Q) { point[A[i]]++; }
  rep(i, N) {
    if (point[i] > 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
Problem p02911 (C++)

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

/*int main(){//B
    string S;
    cin>>S;
    rep(i,0,S.size()){
        if(i%2==0){
            if(S[i]!='R'&&S[i]!='U'&&S[i]!='D') {
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(i%2!=0){
            if(S[i]!='L'&&S[i]!='U'&&S[i]!='D'){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}*/

int main() {
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> A(N, K - Q);
  // vector<int> B(Q);
  int c = N;
  rep(i, 0, Q) {
    int b;
    cin >> b;
    if (b != i + 1)
      A[i]++;
  }
  rep(i, 0, N) {
    if (A[i] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

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

/*int main(){//B
    string S;
    cin>>S;
    rep(i,0,S.size()){
        if(i%2==0){
            if(S[i]!='R'&&S[i]!='U'&&S[i]!='D') {
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(i%2!=0){
            if(S[i]!='L'&&S[i]!='U'&&S[i]!='D'){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}*/

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

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

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

  vector<int> score(N);

  for (ll i = 0; i < N; i++) {
    score.at(i) = K - Q;
  }

  for (ll i = 0; i < Q; i++) {
    int a;
    cin >> a;
    score.at(a)++;
  }

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

  return 0;
}

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

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

  vector<int> score(N);

  for (ll i = 0; i < N; i++) {
    score.at(i) = K - Q;
  }

  for (ll i = 0; i < Q; i++) {
    int a;
    cin >> a;
    score.at(a - 1)++;
  }

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

  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = 5e4 + 10, MAXM = 1e6 + 10;
const int INF = ~(1 << 31), MOD = 1e9 + 7;
int a[MAXN];

int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= q; i++) {
    int temp;
    scanf("%d", &temp);
    a[temp]++;
  }
  for (int i = 1; i <= n; i++)
    if (a[i] + m - q > 0)
      puts("Yes");
    else
      puts("No");
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = 1e5 + 10, MAXM = 1e6 + 10;
const int INF = ~(1 << 31), MOD = 1e9 + 7;
int a[MAXN];

int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= q; i++) {
    int temp;
    scanf("%d", &temp);
    a[temp]++;
  }
  for (int i = 1; i <= n; i++)
    if (a[i] + m - q > 0)
      puts("Yes");
    else
      puts("No");
  return 0;
}
Problem p02911 (C++)

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

int main() { // 参加者のポイントをQ減らし、正解者にポ
  // イントを増やしていく実装
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> s(N, K - Q); // あらかじめ参加者のポイント
  // を減らしておく
  vector<int> A(Q);
  for (int i = 0; i < Q; i++)
    cin >> A.at(i);
  for (int i = 0; i < Q; i++) {
    for (int j = 0; j < N; j++) {
      if ((j + 1) == A.at(i)) {
        s.at(j)++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    if (s.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}

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

int main() { // 参加者のポイントをQ減らし、正解者にポ
  // イントを増やしていく実装
  int N, K, Q;
  cin >> N >> K >> Q;
  vector<int> s(N, K - Q); // あらかじめ参加者のポイント
  // を減らしておく
  vector<int> A(Q);
  for (int i = 0; i < Q; i++)
    cin >> A.at(i);
  for (int i = 0; i < Q; i++) {
    s.at(A.at(i) - 1)++;
  }
  for (int i = 0; i < N; i++) {
    if (s.at(i) <= 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}