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

Buggy submission (status: Runtime Error):
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main() {
  vector<string> S = {"Sunny", "Cloudy", "Rainy", "Sunny"};
  string s;
  cin >> s;
  rep(i, s.size()) {
    if (s == S[i]) {
      cout << s[i + 1];
    }
  }
}

Fixed submission:
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main() {
  vector<string> S = {"Sunny", "Cloudy", "Rainy", "Sunny"};
  string s;
  cin >> s;
  rep(i, s.size()) {
    if (s == S[i]) {
      cout << S[i + 1];
      exit(0);
    }
  }
}
Problem p02909 (C++)

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

typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef priority_queue<int, vector<int>, greater<int>> min_pq;

const int MOD = 1e9 + 7;

#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define init(a) memset(a, 0, sizeof(a))
#define pb push_back
#define all(a) a.begin(), a.end()
#define loop(i, n) for (int i = 0; i < n; i++)
#define loops(i, s, n) for (int i = s; i < n; i++)
#define rloop(i, n) for (int i = n - 1; i >= 0; i--)
#define rloops(i, s, n) for (int i = n - 1; i >= s; i--)

template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }

double tick() {
  static clock_t oldt, newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
//---------------------------------------------------------------------------------------------

int main() {
  fastio;

#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
#endif

  string ans[3];
  ans[0] = "Sunny";
  ans[1] = "Cloudy";
  ans[2] = "Rainy";
  string s;
  cin >> s;
  loop(i, 3) {
    if (s == ans[i]) {
      cout << ans[(i + 1) % 3] << endl;
      break;
    }
  }
  // cout<<"Execution time : "<<tick()<<"\n";

  return 0;
}

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

typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef priority_queue<int, vector<int>, greater<int>> min_pq;

const int MOD = 1e9 + 7;

#define fastio                                                                 \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define init(a) memset(a, 0, sizeof(a))
#define pb push_back
#define all(a) a.begin(), a.end()
#define loop(i, n) for (int i = 0; i < n; i++)
#define loops(i, s, n) for (int i = s; i < n; i++)
#define rloop(i, n) for (int i = n - 1; i >= 0; i--)
#define rloops(i, s, n) for (int i = n - 1; i >= s; i--)

template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }

double tick() {
  static clock_t oldt, newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
//---------------------------------------------------------------------------------------------

int main() {
  fastio;

  // #ifndef ONLINE_JUDGE
  // 	freopen("in.txt", "r", stdin);
  // #endif

  string ans[3];
  ans[0] = "Sunny";
  ans[1] = "Cloudy";
  ans[2] = "Rainy";
  string s;
  cin >> s;
  loop(i, 3) {
    if (s == ans[i]) {
      cout << ans[(i + 1) % 3] << endl;
      break;
    }
  }
  // cout<<"Execution time : "<<tick()<<"\n";

  return 0;
}
Problem p02909 (C++)

Buggy submission (status: Runtime Error):
// VU TRUONG AN
#include <bits/stdc++.h>
#define FORX(i, x, y) for (int i = x; i <= y; ++i)
#define FORN(i, x, y) for (int i = x; i >= y; --i)
#define reset(x, y) memset(x, y, sizeof(x))
#define bp(i) (1 << i)
#define F first
#define S second
#define maxn 100001
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define bit(p, x) ((x >> p) & 1)
#define Task "ATC"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<db> vdb;
typedef vector<str> vstr;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdb;

const int base = 100003;
const long long MM = 1ll * MOD * MOD;
const int maxc = 2e9;

int n, a[maxn];

void Solve() {
  string s;
  cin >> s;
  if (s == "Sunny")
    cout << "Cloudy";
  else if (s == "Cloudy")
    cout << "Rainy";
  else
    cout << "Sunny";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen(Task ".inp", "r", stdin);
  freopen(Task ".out", "w", stdout);
#endif
  Solve();

#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}


Fixed submission:
// VU TRUONG AN
#include <bits/stdc++.h>
#define FORX(i, x, y) for (int i = x; i <= y; ++i)
#define FORN(i, x, y) for (int i = x; i >= y; --i)
#define reset(x, y) memset(x, y, sizeof(x))
#define bp(i) (1 << i)
#define F first
#define S second
#define maxn 100001
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define bit(p, x) ((x >> p) & 1)
#define Task "ATC"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<db, db> pdd;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<db> vdb;
typedef vector<str> vstr;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdb;

const int base = 100003;
const long long MM = 1ll * MOD * MOD;
const int maxc = 2e9;

int n, a[maxn];

void Solve() {
  string s;
  cin >> s;
  if (s == "Sunny")
    cout << "Cloudy";
  else if (s == "Cloudy")
    cout << "Rainy";
  else
    cout << "Sunny";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  Solve();

#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
import bisect

N, M = list(map(int, input().split(" ")))
As = list(map(int, input().split(" ")))
# osoi
As = sorted([-a for a in As])
while M:
    hoge = -As.pop(0) // 2
    M -= 1
    while M and As and hoge < As[1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, -hoge)
print(-sum(As))


Fixed submission:
# coding: utf-8
# Your code here!
s = input()
l = ["Sunny", "Cloudy", "Rainy"] + ["Sunny", "Cloudy", "Rainy"]
print(l[l.index(s) + 1])
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
S = input().strip()

weather = ["Sunny", "Cloudy", "Rainy"]


idx = weather.index(S) + 1
if idx > len(weather):
    print(weather[0])
else:
    print(weather[idx])


Fixed submission:
S = input().strip()

weather = ["Sunny", "Cloudy", "Rainy"]


idx = weather.index(S) + 1
if idx >= len(weather):
    print(weather[0])
else:
    print(weather[idx])
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
import sys

S = sys.stdin.readline().rstrip()

WS = ["Sunny", "Cloudy", "Rainy"]

i = WS.index(S)
i += 1
if i == 2:
    i = 0

print(WS[i])


Fixed submission:
import sys

S = sys.stdin.readline().rstrip()

WS = ["Sunny", "Cloudy", "Rainy"]

i = WS.index(S)
i += 1
if i == 3:
    i = 0

print(WS[i])
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
s = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[weather.index(s) + 1])


Fixed submission:
s = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(s) + 1) % 3])
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
w = input()
weather = ["Sunny", "Cloudy", "Rainy"]

index = weather.index(w)
index += 1
if index == 2:
    index = 0

print(weather[index])


Fixed submission:
w = input()
weather = ["Sunny", "Cloudy", "Rainy"]

index = weather.index(w)
index += 1
if index == 3:
    index = 0

print(weather[index])
Problem p02909 (Python)

Buggy submission (status: Runtime Error):
x = input()
list = ["Sunny", "Cloudy", "Rainy", "Sunny"]

for i in range(len(list)):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)


Fixed submission:
x = input()
list = ["Sunny", "Cloudy", "Rainy", "Sunny"]

for i in range(len(list) - 1):
    theday = list[i]
    if x == theday:
        answer = list[i + 1]
print(answer)
Problem p02909 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define sz(x) x.size()
#define rep(n) for (ll i = 0; i < n; i++)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define DEC(i, x, y) for (int i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a + n
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define int long long int
#define ull unsigned long long

using namespace std;
const int MOD = 1e9 + 7;

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
#endif
  string s;
  cin >> s;
  if (s == "Sunny") {
    cout << "Cloudy" << endl;
  } else if (s == "Cloudy") {
    cout << "Rainy" << endl;
  } else {
    cout << "Sunny" << endl;
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define sz(x) x.size()
#define rep(n) for (ll i = 0; i < n; i++)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define DEC(i, x, y) for (int i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a + n
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define int long long int
#define ull unsigned long long

using namespace std;
const int MOD = 1e9 + 7;

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  if (s == "Sunny") {
    cout << "Cloudy" << endl;
  } else if (s == "Cloudy") {
    cout << "Rainy" << endl;
  } else {
    cout << "Sunny" << endl;
  }
  return 0;
}
Problem p02910 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
  char a[10];
  scanf("%s", a);
  int l = strlen(a);
  int flag = 1;
  for (int i = 0; i < l; i++) {
    if (i % 2 == 0) {
      if (a[i] == 'L') {
        flag = 0;
        break;
      }
    } else {
      if (a[i] == 'R') {
        flag = 0;
        break;
      }
    }
  }
  if (flag == 0)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}


Fixed submission:
#include <algorithm>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
  char a[1000];
  scanf("%s", a);
  int l = strlen(a);
  int flag = 1;
  for (int i = 0; i < l; i++) {
    if (i % 2 == 0) {
      if (a[i] == 'L') {
        flag = 0;
        break;
      }
    } else {
      if (a[i] == 'R') {
        flag = 0;
        break;
      }
    }
  }
  if (flag == 0)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
Problem p02910 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define F first
#define S second
#define all(a) a.begin(), a.end()
#define setDP(arr) memset(arr, -1, sizeof arr)
#define oo 2000000000
#define inf 1000000000000000LL
#define M 1000000007
typedef long long ll;
using namespace std;
const int N = 105001;

map<string, string> mp;

signed main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'L' && (i % 2 == 0) || s[i] == 'R' && (i & 1))
      return puts("No");
  }
  puts("Yes");

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define F first
#define S second
#define all(a) a.begin(), a.end()
#define setDP(arr) memset(arr, -1, sizeof arr)
#define oo 2000000000
#define inf 1000000000000000LL
#define M 1000000007
typedef long long ll;
using namespace std;
const int N = 105001;

map<string, string> mp;

signed main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'L' && (i % 2 == 0) || s[i] == 'R' && (i & 1))
      return puts("No"), 0;
  }
  puts("Yes");

  return 0;
}
Problem p02910 (C++)

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

using namespace std;

int main() {
  string s;
  int n;
  cin >> s;
  n = (int)s.length();
  for (int i = 0; i < n; i + 2) {
    if (s[i] == 'L') {
      cout << "No" << endl;
      return 0;
    } else if (s[i + 1] == 'R') {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

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

using namespace std;

int main() {
  string s;
  int n;
  cin >> s;
  n = (int)s.length();
  for (int i = 0; i < n; i += 2) {
    if (s[i] == 'L') {
      cout << "No" << endl;
      return 0;
    } else if (s[i + 1] == 'R') {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
Problem p02910 (C++)

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

int main() {
  string S;
  cin >> S;
  bool flag = true;
  for (int i = 0; i < S.size(); i += 2) {
    if (S.at(i) == 'L') {
      flag = false;
    }

    if (S.at(i + 1) == 'R') {
      flag = false;
    }
  }

  if (flag == true) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main() {
  string S;
  cin >> S;
  bool flag = true;
  for (int i = 0; i < S.size(); i += 2) {
    if (S.at(i) == 'L') {
      flag = false;
    }
  }
  for (int i = 0; i + 1 < S.size(); i += 2) {
    if (S.at(i + 1) == 'R') {
      flag = false;
    }
  }

  if (flag == true) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02910 (C++)

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

int main(void) {

  string s;
  cin >> s;

  int i = 1;
  while (1) {
    if (i % 2 == 1) {
      if (s[i - 1] != 'L') {
        i++;
      } else {
        cout << "No" << endl;
        break;
      }
    }

    else {
      if (s[i - 1] != 'R') {
        i++;
      } else {
        cout << "No" << endl;
        break;
      }
    }

    if (i == s.length()) {
      cout << "Yes" << endl;
      break;
    }
  }

  return 0;
}

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

int main(void) {

  string s;
  cin >> s;

  int i = 1;
  while (1) {
    if (i % 2 == 1) {
      if (s[i - 1] != 'L') {
        i++;
      } else {
        cout << "No" << endl;
        break;
      }
    }

    else {
      if (s[i - 1] != 'R') {
        i++;
      } else {
        cout << "No" << endl;
        break;
      }
    }

    if (i - 1 == s.length()) {
      cout << "Yes" << endl;
      break;
    }
  }

  return 0;
}
Problem p02910 (C++)

Buggy submission (status: Time Limit Exceeded):
#include "bits/stdc++.h"
#pragma GCC optimize("Ofast")

// Begin {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

template <class A, class B> inline bool chmax(A &a, const B &b) {
  return b > a && (a = b, true);
}
template <class A, class B> inline bool chmin(A &a, const B &b) {
  return b < a && (a = b, true);
}

template <class T> inline vector<T> make_v(const T &initvalue, size_t sz) {
  return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
  return vector<decltype(make_v<T>(initvalue, args...))>(
      sz, make_v<T>(initvalue, args...));
}

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
// }}} End

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  string s;
  cin >> s;

  size_t N = s.length();
  for (size_t i = 0; i < N; i *= 2) {
    if (s[i] != 'R' && s[i] != 'U' && s[i] != 'D') {
      return cout << "No"
                  << "\n",
             0;
    }
  }

  for (size_t i = 1; i < N; i += 2) {
    if (s[i] != 'L' && s[i] != 'U' && s[i] != 'D') {
      return cout << "No"
                  << "\n",
             0;
    }
  }

  cout << "Yes"
       << "\n";

  return 0;
}


Fixed submission:
#include "bits/stdc++.h"
#pragma GCC optimize("Ofast")

// Begin {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

template <class A, class B> inline bool chmax(A &a, const B &b) {
  return b > a && (a = b, true);
}
template <class A, class B> inline bool chmin(A &a, const B &b) {
  return b < a && (a = b, true);
}

template <class T> inline vector<T> make_v(const T &initvalue, size_t sz) {
  return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
  return vector<decltype(make_v<T>(initvalue, args...))>(
      sz, make_v<T>(initvalue, args...));
}

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
// }}} End

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  string s;
  cin >> s;

  size_t N = s.length();
  for (size_t i = 0; i < N; i += 2) {
    if (s[i] != 'R' && s[i] != 'U' && s[i] != 'D') {
      return cout << "No"
                  << "\n",
             0;
    }
  }

  for (size_t i = 1; i < N; i += 2) {
    if (s[i] != 'L' && s[i] != 'U' && s[i] != 'D') {
      return cout << "No"
                  << "\n",
             0;
    }
  }

  cout << "Yes"
       << "\n";

  return 0;
}
Problem p02910 (Python)

Buggy submission (status: Runtime Error):
S = list(input())
flag = True
for i in range(0, int(len(S) / 2 + 1), 2):
    if S[i] == "L":
        flag = False
    if S[i + 1] == "R":
        flag = False

if flag:
    print("Yes")
else:
    print("No")


Fixed submission:
S = list(input())
flag = True
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "L":
            flag = False
    else:
        if S[i] == "R":
            flag = False

if flag:
    print("Yes")
else:
    print("No")
Problem p02910 (C++)

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

int main() {
  string s;
  cin >> s;

  for (int i = 0; i < s.length(); i++) {
    if (i % 0 == 0) // 偶数
    {
      if (s[i] == 'R' || s[i] == 'U' || s[i] == 'D')
        continue;
      else {
        cout << "No";
        return 0;
      }
    } else {
      if (s[i] == 'L' || s[i] == 'U' || s[i] == 'D')
        continue;
      else {
        cout << "No";
        return 0;
      }
    }
  }

  cout << "Yes";
}

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

int main() {
  string s;
  cin >> s;

  for (int i = 0; i < s.length(); i++) {
    if (i % 2 == 0) // 偶数
    {
      if (s[i] == 'R' || s[i] == 'U' || s[i] == 'D')
        continue;
      else {
        cout << "No";
        return 0;
      }
    } else {
      if (s[i] == 'L' || s[i] == 'U' || s[i] == 'D')
        continue;
      else {
        cout << "No";
        return 0;
      }
    }
  }

  cout << "Yes";
}
Problem p02910 (C++)

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

int main() {
  std::string S;
  cin >> S;
  bool retbool = true;
  ll i = 0;
  while (retbool && i < S.size()) {
    const char c = S[i];
    if (i % 2 == 0 && c == 'L')
      retbool = false;
    else if (i % 2 == 1 && c == 'R')
      retbool = false;
  }
  if (retbool)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

int main() {
  std::string S;
  cin >> S;
  bool retbool = true;
  ll i = 0;
  while (retbool && i < S.size()) {
    const char c = S[i];
    if (i % 2 == 0 && c == 'L')
      retbool = false;
    else if (i % 2 == 1 && c == 'R')
      retbool = false;
    i++;
  }
  if (retbool)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02910 (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;

int main() {
  string S;
  cin >> S;
  int n;
  bool f = false;
  n = S.size();
  int i = 1;
  while (i <= n) {
    if ((i % 2) == 1) {
      if (S.at(i) == 'L') {
        f = true;
        break;
      }
    } else {
      if (S.at(i) == 'R') {
        f = true;
        break;
      }
    }
    i++;
  }
  if (f == true) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  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() {
  string S;
  cin >> S;
  int n;
  bool f = false;
  n = S.size();
  int i = 0;
  while (i < n) {
    if ((i % 2) == 0) {
      if (S.at(i) == 'L') {
        f = true;
        break;
      }
    } else {
      if (S.at(i) == 'R') {
        f = true;
        break;
      }
    }
    i++;
  }
  if (f == true) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
Problem p02911 (C++)

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

int main() {
  ll N, K, Q;
  cin >> N >> K >> Q;
  vector<ll> A(Q);
  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)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}


Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(obj) (obj).begin(), (obj).end()
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)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
Problem p02911 (C++)

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

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

int main() {
  int N, K, Q;
  scanf("%d %d %d", &N, &K, &Q);
  vector<int> answerers(Q);
  vector<int> state(N, K - Q);

  rep(i, Q) {
    scanf("%d", &answerers[i]);
    rep(k, N) {
      if (answerers.at(i) == k) {
        /* increment answerer */
        state[answerers.at(i) - 1] += 1;
      }
    }
  }

  rep(i, N) {
    if (state[i] > 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
}

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

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

int main() {
  int N, K, Q;
  scanf("%d %d %d", &N, &K, &Q);
  vector<int> answerers(Q);
  vector<int> state(N, K - Q);

  rep(i, Q) {
    scanf("%d", &answerers[i]);
    state[answerers.at(i) - 1] += 1;
  }

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

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

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

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

typedef long long ll;
const ll INF = 1LL << 60, MOD = 1e9 + 7;
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define m_p make_pair

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

  ll n, k, q;
  cin >> n >> k >> q;
  vector<ll> a(q);
  vector<bool> ok(q, false);
  map<ll, ll> mp;
  rep(i, q) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (k - q > 0) {
    rep(i, n) { cout << "Yes" << endl; }
    return 0;
  }
  rep(i, q) {
    if (k - (q - mp[a[i]]) > 0)
      ok[a[i] - 1] = true;
  }
  rep(i, n) {
    if (ok[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}

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

typedef long long ll;
const ll INF = 1LL << 60, MOD = 1e9 + 7;
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define m_p make_pair

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

  ll n, k, q;
  cin >> n >> k >> q;
  vector<ll> a(q);
  vector<bool> ok(n, false);
  map<ll, ll> mp;
  rep(i, q) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (k - q > 0) {
    rep(i, n) { cout << "Yes" << endl; }
    return 0;
  }
  rep(i, q) {
    if (k - (q - mp[a[i]]) > 0)
      ok[a[i] - 1] = true;
  }
  rep(i, n) {
    if (ok[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

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

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))
#define SORT(c) sort((c).begin(), (c).end())
#define vi(m, a) vector<int> m(a)
#define vti(m, a, i) vector<vector<int>> m(a, vector<int>(i))
#define ALL(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define Fe(it, a) for (auto &it : a)
#define all(a) begin(a), end(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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


Fixed submission:
#include <algorithm>
#include <bitset>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

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

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))
#define SORT(c) sort((c).begin(), (c).end())
#define vi(m, a) vector<int> m(a)
#define vti(m, a, i) vector<vector<int>> m(a, vector<int>(i))
#define ALL(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define Fe(it, a) for (auto &it : a)
#define all(a) begin(a), end(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  map<int, int> mp;
  rep(i, q) {
    int tmp;
    cin >> tmp;
    tmp--;
    mp[tmp]++;
  }
  rep(i, n) {
    int res = k - q + mp[i];
    if (res <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
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;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> y(q);
  rep(i, q) cin >> y.at(i);
  rep(i, n) {
    int x = 0;
    for (int j : y)
      if (j == i + 1)
        x++;
    if (0 < k + x - q)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}

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

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> y(q);
  rep(i, q) cin >> y.at(i);
  vector<int> x(n, k - q);
  rep(i, q) x.at(y.at(i) - 1)++;
  for (int i : x) {
    if (0 < i)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
Problem p02911 (Python)

Buggy submission (status: Time Limit Exceeded):
N, K, Q = map(int, input().split(" "))
score = [K for player in range(N)]
answers = [int(input()) - 1 for q in range(Q)]

for answer in answers:
    for i in range(N):
        if i != answer:
            score[i] = score[i] - 1

for result in score:
    if result > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
N, K, Q = map(int, input().split(" "))
score = [K for player in range(N)]
answers = [int(input()) - 1 for q in range(Q)]

for answer in answers:
    score[answer] = score[answer] + 1

score = [point - Q for point in score]

for result in score:
    if result > 0:
        print("Yes")
    else:
        print("No")
Problem p02911 (Python)

Buggy submission (status: Time Limit Exceeded):
import numpy as np

N, K, Q = map(int, input().split())
person = np.asarray([K] * N)

for i in range(Q):
    ok_person = int(input()) - 1
    person -= 1
    person[ok_person] += 1

for i in range(N):
    if person[i] > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
import numpy as np

N, K, Q = map(int, input().split())
person = np.asarray([K] * N)

ok_person = [int(input()) for i in range(Q)]
false_num = len(ok_person)
person -= false_num
# print(person)
for i in ok_person:
    person[i - 1] += 1
#    print(person)

# print(person)

for i in range(N):
    if person[i] > 0:
        print("Yes")
    else:
        print("No")
Problem p02911 (Python)

Buggy submission (status: Runtime Error):
n, k, q = map(int, input().split())

scores = [k - q] * n

for index in range(q):
    winner = int(input())
    scores[winner] += 1

for participant in range(n):
    print("Yes") if scores[participant] > 0 else print("No")


Fixed submission:
n, k, q = map(int, input().split())

scores = [k - q] * n

for index in range(q):
    winner = int(input())
    scores[winner - 1] += 1

for participant in range(n):
    print("Yes") if scores[participant] > 0 else print("No")
Problem p02911 (C++)

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

using namespace std;

int main() {
  int n, k, q;
  scanf("%d %d %d", &n, &k, &q);

  vector<int> a(q, 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] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}


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

using namespace std;

int main() {
  int n, k, q;
  scanf("%d %d %d", &n, &k, &q);

  vector<int> a(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] > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }

  return 0;
}
Problem p02911 (C++)

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

int main() {
  int n, k, q;
  std::cin >> n >> k >> q;
  std::vector<int> score(n, k - q); // 各人の点数
  std::vector<int> a(n);            // 正解者
  for (int i = 0; i < q; i++) {
    std::cin >> a[i];
    a[i]--;
  }

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

  for (int i = 0; i < n; i++) {
    std::cout << (score[i] <= 0 ? "No" : "Yes") << std::endl;
  }
}

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

int main() {
  int n, k, q;
  std::cin >> n >> k >> q;
  std::vector<int> score(n, k - q); // 各人の点数
  std::vector<int> a(q);            // 正解者
  for (int i = 0; i < q; i++) {
    std::cin >> a[i];
    a[i]--;
  }

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

  for (int i = 0; i < n; i++) {
    std::cout << (score[i] <= 0 ? "No" : "Yes") << std::endl;
  }
}
Problem p02911 (Python)

Buggy submission (status: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
for i in range(n):
    print("Yes" if k + a.count(i + 1) - q > 0 else "No")


Fixed submission:
n, k, q = map(int, input().split())
nList = [0] * n
for _ in range(q):
    nList[int(input()) - 1] += 1
for j in range(n):
    print("Yes" if k + nList[j] - q > 0 else "No")
Problem p02911 (C++)

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

#define irep(i, n) for (int i = 0; i < (n); i++)
#define irepy(i, n) for (int i = 1; i <= (n); i++)
#define jrep(j, n) for (int j = 0; i < (n); j++)
#define jrepy(j, n) for (int j = 1; i <= (n); j++)

int main() {

  long long n, k, q;
  long long A[10010] = {};
  long long p[10010] = {}; // 個人の点数

  cin >> n >> k >> q; // n=匹数,k=初期点,q=ラウンド数

  for (int i = 0; i < q; i++)
    cin >> A[i];

  if (k > q) { // 終わり
    irep(i, n) { cout << "Yes" << endl; }
    return 0;
  }

  irep(i, n) p[i] = k - q;

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

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


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

#define irep(i, n) for (int i = 0; i < (n); i++)
#define irepy(i, n) for (int i = 1; i <= (n); i++)
#define jrep(j, n) for (int j = 0; i < (n); j++)
#define jrepy(j, n) for (int j = 1; i <= (n); j++)

int main() {

  long long n, k, q;
  long long A[100010] = {};
  long long p[100010] = {}; // 個人の点数

  cin >> n >> k >> q; // n=匹数,k=初期点,q=ラウンド数

  for (int i = 0; i < q; i++)
    cin >> A[i];

  if (k > q) { // 終わり
    irep(i, n) { cout << "Yes" << endl; }
    return 0;
  }

  irep(i, n) p[i] = k - q;

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

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

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

using namespace std;

int main(int argc, char const *argv[]) {
  int N, K, Q;
  cin >> N >> K >> Q;
  int tmp;
  vector<int> A;
  int cnt[10000] = {0};
  for (int i = 0; i < Q; i++) {
    cin >> tmp;
    A.emplace_back(tmp);
    cnt[tmp - 1] += 1;
  }

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

  return 0;
}


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

using namespace std;

int main(int argc, char const *argv[]) {
  int N, K, Q;
  cin >> N >> K >> Q;
  int tmp;
  vector<int> A;
  int cnt[100000] = {0};
  for (int i = 0; i < Q; i++) {
    cin >> tmp;
    A.emplace_back(tmp);
    cnt[tmp - 1] += 1;
  }

  int pnt;
  for (int i = 0; i < N; i++) {
    pnt = K - Q + cnt[i];
    if (pnt > 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;

void Main();
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
}

void Main() {
  auto &fin = cin;
  int64_t n, k, q;
  fin >> n >> k >> q;
  vector<int64_t> a(q);
  for (int64_t i = 0; i < a.size(); ++i) {
    fin >> a[i];
  }
  vector<int64_t> score(n, k - q);
  for (int64_t i = 0; i < a.size(); ++i) {
    score[a[i] + 1]++;
  }
  for (int64_t i = 0; i < score.size(); ++i) {
    if (score[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


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

using namespace std;

void Main();
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
}

void Main() {
  auto &fin = cin;
  int64_t n, k, q;
  fin >> n >> k >> q;
  vector<int64_t> a(q);
  for (int64_t i = 0; i < a.size(); ++i) {
    fin >> a[i];
  }
  vector<int64_t> score(n, k - q);
  for (int64_t i = 0; i < a.size(); ++i) {
    score[a[i] - 1]++;
  }
  for (int64_t i = 0; i < score.size(); ++i) {
    if (score[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, s;
  cin >> n >> k >> q;
  int a = k - q;
  vector<int> vec(n, a);
  for (int i = 0; i < q; i++) {
    cin >> s;
    vec.at(s) += 1;
  }
  for (int i = 0; i < n; i++) {
    if (vec.at(i) > 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


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

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

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

int main() {
  int N; // 参加者人数
  int K; // 初期ポイント
  int Q; // 問題数
  int q; // 問題の正解者

  cin >> N >> K >> Q;

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

  for (int i = 0; i < Q; i++) {
    cin >> q;
    for (int j = 0; j < N; j++) {
      if (j == (q - 1)) {
        challenger[j]++;
      }
    }
  }

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

  return 0;
}

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

int main() {
  int N; // 参加者人数
  int K; // 初期ポイント
  int Q; // 問題数
  int q; // 問題の正解者

  cin >> N >> K >> Q;

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

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

  for (int i = 0; i < N; i++) {
    if (challenger[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;
  ll arr[q];
  ll x;
  for (int i = 0; i < n; i++) {
    arr[i] = k;
  }
  for (int i = 0; i < q; i++) {
    cin >> x;
    arr[x - 1] += 1;
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] - q <= 0)
      cout << "No"
           << "\n";
    else
      cout << "Yes"
           << "\n";
  }
}

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

  ll n, k, q;
  cin >> n >> k >> q;
  ll arr[n];
  ll x;
  for (int i = 0; i < n; i++) {
    arr[i] = k;
  }
  for (int i = 0; i < q; i++) {
    cin >> x;
    arr[x - 1] += 1;
  }
  for (int i = 0; i < n; i++) {
    if (arr[i] - q <= 0)
      cout << "No"
           << "\n";
    else
      cout << "Yes"
           << "\n";
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(), x.end()

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


Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;
#define rep(i, s, e) for (int(i) = (s); (i) <= (e); ++(i))
#define all(x) x.begin(), x.end()

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

Buggy submission (status: Runtime Error):
#include <iostream>
#include <stdio.h>
// #include <bits/stdc++.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <float.h>
#include <iomanip>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

#define INF 1e9
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) <= (int)(b); i++)
#define VEC(type, c, n)                                                        \
  std::vector<type> c(n);                                                      \
  for (auto &i : c)                                                            \
    std::cin >> i;
#define vec(type, n) vector<type>(n)
#define vvec(m, n) vector<vector<int>>(int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

vector<int> bitSearch(int bit, int n) {
  vector<int> S;
  rep(i, n) if (bit & (1 << i)) S.push_back(i);
  return S;
}

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


Fixed submission:
#include <iostream>
#include <stdio.h>
// #include <bits/stdc++.h>
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <float.h>
#include <iomanip>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

#define INF 1e9
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); (i) <= (int)(b); i++)
#define VEC(type, c, n)                                                        \
  std::vector<type> c(n);                                                      \
  for (auto &i : c)                                                            \
    std::cin >> i;
#define vec(type, n) vector<type>(n)
#define vvec(m, n) vector<vector<int>>(int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

vector<int> bitSearch(int bit, int n) {
  vector<int> S;
  rep(i, n) if (bit & (1 << i)) S.push_back(i);
  return S;
}

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

Buggy submission (status: Time Limit Exceeded):
n, k, q = map(int, input().split())
A = [int(input()) for _ in range(q)]
# print(A)
for i in range(1, n + 1):
    if k - q + (A.count(i)) > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
n, k, q = map(int, input().split())
Point = [k - q] * n
for _ in range(q):
    Point[int(input()) - 1] += 1

for e in Point:
    if e > 0:
        print("Yes")
    else:
        print("No")
Problem p02911 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

#define fi first
#define se second
#define LL long long

using namespace std;

const int N = 1e6 + 7;
const LL mod = 1e9 + 7;
const int B = sqrt(1e5);

LL n, k, q;
LL d[4 * N];
LL a[N];

void f(LL x, LL y) {
  while (x < N) {
    d[x] += y;
    x += x & -x;
  }
}

LL ff(LL x) {
  LL cnt = 0;
  while (x > 0) {
    cnt += d[x];
    x -= x & -x;
  }
  return cnt;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  // freopen( "input.txt" , "r" , stdin );
  // freopen( "output.txt" , "w" , stdout );

  cin >> n >> k >> q;
  for (int i = 1; i <= k; i++)
    f(1, 1);
  for (int i = 1; i <= q; i++) {
    LL x;
    cin >> x;
    f(x + 1, -1);
    f(1, -1);
    f(x, 1);
  }
  for (int i = 1; i <= n; i++) {
    LL x = ff(i);
    if (x > 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}


Fixed submission:
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

#define fi first
#define se second
#define LL long long

using namespace std;

const int N = 1e6 + 7;
const LL mod = 1e9 + 7;
const int B = sqrt(1e5);

LL n, k, q;
LL d[4 * N];
LL a[N];

void f(LL x, LL y) {
  while (x < N) {
    d[x] += y;
    x += x & -x;
  }
}

LL ff(LL x) {
  LL cnt = 0;
  while (x > 0) {
    cnt += d[x];
    x -= x & -x;
  }
  return cnt;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  // freopen( "input.txt" , "r" , stdin );
  // freopen( "output.txt" , "w" , stdout );

  cin >> n >> k >> q;
  f(1, k);
  for (int i = 1; i <= q; i++) {
    LL x;
    cin >> x;
    f(x + 1, -1);
    f(1, -1);
    f(x, 1);
  }
  for (int i = 1; i <= n; i++) {
    LL x = ff(i);
    if (x > 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
Problem p02911 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

#define FILE
using namespace std;

int main() {
#ifdef FILEs
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif // FILE
  ios_base::sync_with_stdio(false);

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

  return 0;
}


Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

#define FILE
using namespace std;

int main() {
#ifdef FILEs
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif // FILE
  ios_base::sync_with_stdio(false);

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

  return 0;
}