qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, k, q = map(int, input().split())
    qk = q - k
    l = [0] * (n+1)
    for _ in range(q):
        l[int(input())] += 1
    print('\n'.join(['YES' if (i > qk) else 'NO' for i in l][1:]))

if __name__ == '__main__':
    main()


Fixed code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, k, q = map(int, input().split())
    qk = q - k
    l = [0] * (n+1)
    for _ in range(q):
        l[int(input())] += 1
    print('\n'.join(['Yes' if (i > qk) else 'No' for i in l][1:]))

if __name__ == '__main__':
    main()
Buggy code:
n, k, q = map(int, input().split())
A = [int(i) for i in input().split()]

start = [k - q] * n
for i in range(q):
    start[A[i]] += 1

for i in range(n):
    if start[i] > 0:
        print('Yes')
    else:
        print('No')

Fixed code:
n, k, q = map(int, input().split())
point = [0] * n
for i in range(q):
    point[int(input()) - 1] += 1
for i in range(n):
    if point[i] > q - k:
        print("Yes")
    else:
        print("No")
Buggy code:
n,k,q = map(int,input().split())
a=[int(input()) for i in range(q)]

m = [k-len(a)] * n
for i in a:
    m[a[i]-1] = m[a[i]-1] + 1

for j in range(n):
    if m[j] <= 0:
        print("No")
    else:
        print("Yes")

Fixed code:
n,k,q = map(int,input().split())
a=[int(input()) for i in range(q)]

m = [k-q] * n
for i in range(q):
    m[a[i]-1] = m[a[i]-1] + 1
    
for j in range(n):
    if m[j] <= 0:
        print("No")
    else:
        print("Yes")
Buggy code:
N, K, Q=list(map(int,input().split()))
points = K * np.ones(N)
for i in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] += 1
for i in range(N):
    if points[i] > 0:
        print('Yes')
    else:
        print('No')

Fixed code:
N, K, Q = map(int, input().split())
A = [0] * Q
for i in range(Q):
    A[i] = int(input())
list = [K-Q] *N
for i in range(Q):
  list[A[i]-1] += 1
for i in range(N):
  if list[i] >= 1:
    print('Yes')
  else:
    print('No')
Buggy code:
n, k, q = map(int, input().split())
a = [int(input()) for i in range(q)]
p = [k for i in range(n)]
print(a)
print(p)
def judge(x):
    if p[x] <= 0:
        return 'No'
    else:
        return 'Yes'
for j in range(q):
    for i in range(n):
     if i + 1 == a[j]:
        continue
     else:
        p[i] -= 1
print(p)
b = [judge(i) for i in range(n)]
print('\n'.join(b))

Fixed code:
n, k, q = map(int, input().split())
a = [int(input()) for i in range(q)]
p = [k for i in range(n)]
def judge(x):
    if p[x] - q <= 0:
        return 'No'
    else:
        return 'Yes'
for i in range(q):
    p[a[i] - 1] += 1
b = [judge(i) for i in range(n)]
print('\n'.join(b))
Buggy code:
n, k, q = list(map(int, input().split()))
a = [int(input()) for i in range(q)]
p = [k - q] * n
for i in range(q):

    p[a - 1] += 1
for i in range(n):
    if(p[i] > 0):
        print('Yes')
    else:
        print('No')

Fixed code:
n, k, q = list(map(int, input().split()))
a = [int(input()) for i in range(q)]
p = [k - q] * n
for i in range(q):
    p[a[i] - 1] += 1
for i in range(n):
    if(p[i] > 0):
        print('Yes')
    else:
        print('No')
Buggy code:
member, start, round = list(map(int, input().split()))
answer = [0] * (member+1)
for i in range(round):
    answer[int(input())] += 1
print(answer)
for i in range(member):
    if start - (round - answer[i+1]) <= 0:
        print("No")
    else:
        print("Yes")

Fixed code:
member, start, round = list(map(int, input().split()))
answer = [0] * (member+1)
for i in range(round):
    answer[int(input())] += 1
for i in range(member):
    if start - (round - answer[i+1]) <= 0:
        print("No")
    else:
        print("Yes")
Buggy code:
n, k, q = map(int, input().split())
p = [-q+k]*n

for i in range(0, q):
    p[int(input())-1] += 1
print(p)
for i in range(0, n):
    if p[i] > 0:
        print('Yes')
    else:
        print('No')


Fixed code:
n, k, q = map(int, input().split())
p = [-q+k]*n

for i in range(0, q):
    p[int(input())-1] += 1
for i in range(0, n):
    if p[i] > 0:
        print('Yes')
    else:
        print('No')
Buggy code:
N,K,Q = (int(i) for i in input().split())

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

for i in range(Q):
  if points[i] <= 0:
    print("No")
  else:
    print("Yes")


Fixed code:
N,K,Q = (int(i) for i in input().split())

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

for i in range(N):
  if points[i] <= 0:
    print("No")
  else:
    print("Yes")
Buggy code:
n,k,q = map(int,(input().split()))

an = [0] * n

for i in range(q):
    an[int(input())] += 1

ans = ["No","Yes"]

for j in range(n):
    print(ans[k-q+an[j]>0])

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

an = [0] * n

for i in range(q):
    an[int(input())-1] += 1

ans = ["No","Yes"]
#print(an)
for j in range(n):
    print(ans[k-q+an[j]>0])
Buggy code:
n, k, q = map(int, input().split())

answers = []
for i in range(q):
    a = int(input())
    answers.append(a)

players = []
for i in range(n):
    players.append(0)

for i in range(q):
    players[answers[i] - 1] += 1

ans_list = []
for i in range(n):
    if k - q + players[i] <= 0:
        ans_list.append('No')
    else:
        ans_list.append('Yes')

print(ans_list)


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

answers = []
for i in range(q):
    a = int(input())
    answers.append(a)

players = []
for i in range(n):
    players.append(0)

for i in range(q):
    players[answers[i] - 1] += 1


for i in range(n):
    if k - q + players[i] <= 0:
        print('No')
    else:
        print('Yes')
Buggy code:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for a in A:
    ans[a-1] += 1
print(ans)
for n in range(N):
    if ans[n] > 0:
        print("Yes")
    else:
        print("No")


Fixed code:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ans = [K-Q]*N
for a in A:
    ans[a-1] += 1
for n in range(N):
    if ans[n] > 0:
        print("Yes")
    else:
        print("No")
Buggy code:




def calculate(n,k,q,arr):
    result = [k]*n
    print(result)
    for index in range(q):
        result[arr[index] - 1] = result[arr[index] - 1] + 1

    for index in range(len(result)):
        if (result[index] - q) > 0:
            print("Yes")
        else:
            print("No")

N,K,Q = input().split(' ')
N = int(N)
K = int(K)
Q = int(Q)

arr = []
for i in range(Q):
    arr.append(int(input()))

calculate(N,K,Q,arr)

Fixed code:




def calculate(n,k,q,arr):
    result = [k]*n
    for index in range(q):
        result[arr[index] - 1] = result[arr[index] - 1] + 1

    for index in range(len(result)):
        if (result[index] - q) > 0:
            print("Yes")
        else:
            print("No")

N,K,Q = input().split(' ')
N = int(N)
K = int(K)
Q = int(Q)

arr = []
for i in range(Q):
    arr.append(int(input()))

calculate(N,K,Q,arr)
Buggy code:
import numpy as np
N , K ,Q = map(int, input().split())
initializer_list = [0] * N
print(initializer_list)
for _ in range(Q):
    i = int(input())-1
    initializer_list[i] += 1
    

[print('Yes') if (Q - initializer_list[i] < K) else print('No')  for i in range(N)]


Fixed code:
import numpy as np
N , K ,Q = map(int, input().split())
initializer_list = [0] * N
for _ in range(Q):
    i = int(input())-1
    initializer_list[i] += 1
    

[print('Yes') if (Q - initializer_list[i] < K) else print('No')  for i in range(N)]
Buggy code:
N, K, Q = list(map(lambda n: int(n), input().split(" ")))
point = [K - Q] * N
for i in range(N):
  c = int(input())
  point[c - 1] += 1

print("\n".join(["YES" if p > 0 else "NO" for p in point]))

Fixed code:
N, K, Q = list(map(lambda n: int(n), input().split(" ")))
point = [K - Q] * N
for i in range(Q):
  c = int(input())
  point[c - 1] += 1

print("\n".join(["Yes" if p > 0 else "No" for p in point]))
Buggy code:
import numpy as np
n, k, q = map(int, input().split())
A = np.array([int(input()) - 1 for _ in range(q)])
score = np.zeros(n)
for i in A:
    score[i] += 1
score = k + score - 4
print(*np.where(score > 0, 'Yes', 'No'), sep='\n')

Fixed code:
import numpy as np
n, k, q = map(int, input().split())
A = np.array([int(input()) - 1 for _ in range(q)])
score = np.zeros(n)
for i in A:
    score[i] += 1
score = k + score - q
print(*np.where(score > 0, 'Yes', 'No'), sep='\n')
Buggy code:
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
point=[-k]*n
for i in range(q):
  point[a[i]]+=1
for i in range(n):
  if point[i]>-2k+q:
    print('Yes')
  else:
    print('No')
    
  


Fixed code:
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]
point=[-k]*n
for i in range(q):
  point[a[i]-1]+=1
for i in range(n):
  if point[i]>-2*k+q:
    print('Yes')
  else:
    print('No')
Buggy code:
n,k,q=map(int,input().split())
a=[0 for i in range(n)]
for i in range(q):
    a[int(input())-1]+=1
for i in range(n):
    if i>k-q:
        print('Yes')
    else:
        print('No')

Fixed code:
n,k,q=map(int,input().split())
a=[0 for i in range(n)]
for i in range(q):
    a[int(input())-1]+=1
for i in a:
    if k-q+i>0:
        print('Yes')
    else:
        print('No')
Buggy code:
N, K, Q = map(int, input().split())
A = [int(input())-1 for _ in range(Q)]
Point = [K]*N
print(A)
for i in range(Q):
    Point[A[i]] += 1
    for j in range(N):
        Point[j] -= 1

for p in Point:
    if p>0:
        print('Yes')
    else:
        print('No')

Fixed code:
N, K, Q = map(int, input().split())
A = [int(input())-1 for _ in range(Q)]
Point = [K-Q]*N
for i in range(Q):
    Point[A[i]] += 1

for p in Point:
    if p>0:
        print('Yes')
    else:
        print('No')
Buggy code:
N, K, Q = [int(i) for i in input().split()]
ls = [K] * N

for i in range(Q):
    a = int(input())
    ls[a - 1] += 1
    print(ls)

for l in ls:
    if l - Q > 0:
        print('Yes')
    else:
        print('No')


Fixed code:
N, K, Q = [int(i) for i in input().split()]
ls = [K] * N

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

for l in ls:
    if l - Q > 0:
        print('Yes')
    else:
        print('No')
Buggy code:
n, k, q = map(int, input().split())
v = [0] * n

for _ in range(q):
  v[int(input())+1] += 1

for x in v:
  if x + k - q > 0:
    print('Yes')
  else:
    print('No')


Fixed code:
n, k, q = map(int, input().split())
v = [0] * n

for _ in range(q):
  v[int(input())-1] += 1

for x in v:
  if x + k - q > 0:
    print('Yes')
  else:
    print('No')
Buggy code:
n,k,q = tuple(map(int,input().split()))

check = []

for _ in [0]*q:
  check[int(input())-1]+=1
  
for i in range(n):
  judge = k-(q-check[i])
  if judge<=0:
    print("No")
  else:
    print("Yes")

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

check = [0]*n

for _ in [0]*q:
  check[int(input())-1]+=1
  
for i in range(n):
  judge = k-(q-check[i])
  if judge<=0:
    print("No")
  else:
    print("Yes")
Buggy code:
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
sanka = [K for _ in range(N)]

print(sanka)

for ai in A:
    sanka[ai-1] += 1

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


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

for ai in A:
    sanka[ai-1] += 1

for i in range(N):
    if sanka[i] - Q > 0:
        print("Yes")
    else:
        print("No")
Buggy code:
N, K ,Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

test = {}
for i in A:
  if i in test:
    test[i]+=1
  else:
    test[i]=1

for j in range(1,N+1):
    if j in test:
        if test[j]+K-Q >= 1:
            print("Yes")
        else:
            print("No")
    else:
        if K-Q >= 1:
            print("Yes_")
        else:
            print("No")

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

test = {}
for i in A:
  if i in test:
    test[i]+=1
  else:
    test[i]=1

for j in range(1,N+1):
    if j in test:
        if test[j]+K-Q >= 1:
            print("Yes")
        else:
            print("No")
    else:
        if K-Q >= 1:
            print("Yes")
        else:
            print("No")
Buggy code:
n, k, q = map(int, input().split())
a = [int(input()) for i in range(q)]

if k >= q:
    print(n)
    exit()

ans = 0
for i in range(1, n + 1):
    if q - a.count(i) < k:
        print('Yes')
    else:
        print('No')


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

if k > 0:
    for i in range(n):
        print('Yes')
    exit()

a = [int(input()) for i in range(q)]
n_a = [k] * n

for i in range(q):
    n_a[a[i] - 1] += 1

ans = 0
for i in n_a:
    if i <= 0:
        print('No')
    else:
        print('Yes')
Buggy code:
n,k,q= list(map(int, input().split()))
lis=[k]*n
for i in range(q):
    a=int(input())
    a-=1
    lis=map(lambda x: x-1, lis)
    lis[a]+=1
for i in range(n):
    if lis[i]>0:
        print("Yes")
    else:
        print("No")


Fixed code:
n,k,q= list(map(int, input().split()))
lis=[k-q]*n
for i in range(q):
    a=int(input())
    a-=1
    lis[a]+=1
    
for i in range(n):
    if lis[i]>0:
        print("Yes")
    else:
        print("No")
Buggy code:
import sys

N, K, Q = map(int, input().split())
a = list(int(input()) for i in range(Q))

anslst = ['YES'] * N
plst = [0] * N

if K > Q:
    for i in anslst:
        print(i)
    sys.exit()

for i in range(Q):
    plst[a[i] - 1] += 1

for i in range(N):
    if K - (Q - plst[i]) > 0:
        anslst[i] = 'Yes'
    else:
        anslst[i] = 'No'

for i in anslst:
    print(i)

Fixed code:
import sys

N, K, Q = map(int, input().split())
a = list(int(input()) for i in range(Q))

anslst = ['YES'] * N
plst = [0] * N

for i in range(Q):
    plst[a[i] - 1] += 1

for i in range(N):
    if K - (Q - plst[i]) > 0:
        anslst[i] = 'Yes'
    else:
        anslst[i] = 'No'

for i in anslst:
    print(i)
Buggy code:
n, k, q = map(int, input().split())
points = []
for i in range(1, n+1):
    points[i] = k
for j in range(q):
    answer = int(input())
    for i in range(1, n + 1):
        if i == answer:
            continue
        else:
            points[i] -= 1
for i in range(1, n+1):
    if points[i] > 0:
        print("Yes")
    else:
        print('No')

Fixed code:
n, k, q = map(int, input().split())
points = [0 for _ in range(n + 1)]
for i in range(q):
    answer = int(input())
    points[answer] += 1
for i in range(1, n + 1):
    if (points[i] + k - q) > 0:
        print("Yes")
    else:
        print('No')
Buggy code:
import sys

N,K,Q = map(int,input().split())

status = [0]*N

input = sys.stdin.readline

need_win = Q-K

if (Q-K)<1:
    for _ in range(N):
        print('Yes')
        exit(0)

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

for i in range(N):
    print('Yes' if status[i]>need_win else 'No')



Fixed code:
import sys

N,K,Q = map(int,input().split())

status = [0]*N

input = sys.stdin.readline

need_win = Q-K+1


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


if need_win<=0:
    for _ in range(N):
        print('Yes')
    exit(0)

for i in range(N):
    print('Yes' if status[i]>=need_win else 'No')
Buggy code:
N,K,Q=map(int,input().split())
A = [int(input()) for i in range(Q)]

import collections
c = collections.Counter(A)
c_i=c.items()

m=[K-Q]*N
print(m)
for i in c_i:
    m[i[0]-1]=m[i[0]-1]+i[1]
o=[]

for i in m:
    if i<=0:
        o.append('No')
    else:
        o.append('Yes')
print('\n'.join(o))

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

import collections
c = collections.Counter(A)
c_i=c.items()

m=[K-Q]*N
for i in c_i:
    m[i[0]-1]=m[i[0]-1]+i[1]
o=[]

for i in m:
    if i<=0:
        o.append('No')
    else:
        o.append('Yes')
print('\n'.join(o))
Buggy code:
import collections

N,K,Q = map(int,input().split())
li = [int(input()) for i in range(Q)]
ans = [0]*N
lis = collections.Counter(li)
for w in lis:
    ans[w-1] = K-(Q-lis[w])
for i in range(N):
    if ans[i] <= 0:
        ans[i] = 'No'
    else:
        ans[i] = 'Yes'
    print(ans[i])


Fixed code:
import collections

N,K,Q = map(int,input().split())
li = [int(input()) for i in range(Q)]
ans = [0]*N
lis = collections.Counter(li)
for w in lis:
    ans[w-1] = K-(Q-lis[w])
for i in range(N):
    if i+1 not in lis:
        ans[i] = K-Q
for i in range(N):
    if ans[i] <= 0:
        ans[i] = 'No'
    else:
        ans[i] = 'Yes'
    print(ans[i])
Buggy code:
n,k,q=map(int,input().split())
A=[0]*n
for i in range(q):
  A[int(input())-1]+=1
for i in range(n):
  if k-q+2*A[i]<=0:
    print("No")
  else:
    print("Yes")



Fixed code:
n,k,q=map(int,input().split())
A=[0]*n
for i in range(q):
  A[int(input())-1]+=1
for i in range(n):
  if k-q+A[i]<=0:
    print("No")
  else:
    print("Yes")
Buggy code:
N, K, Q = map(int, input().split())
A = [Q-K]*N
for i in range(Q):
    a = int(input())
    A[a-1] += 1

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

Fixed code:
N, K, Q = map(int,input().split())
A = [0 for i in range(N)]
for i in range(Q):
    a = int(input())
    A[a-1] += 1
for i in range(N):
    if(K - Q + A[i] > 0):
        print("Yes")
    else:
        print("No")
Buggy code:
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(Q)]
li=np.array([0]*n)
d=np.array([k-q]*n)
for j in range(0,len(a)):
    li[a[j]-1]+=1

    
ans=np.array(li+d)
print(ans)
for m in range(0,n):
    if ans[m]>0:
        print("Yes")
    else:
        print("No")

Fixed code:
import numpy as np
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
li=np.array([0]*n)
d=np.array([k-q]*n)

for j in range(0,len(a)):
  li[a[j]-1]+=1

  
ans=np.array(li+d)


for m in range(0,n):
  if ans[m]>0:
    print("Yes")
  else:
    print("No")
Buggy code:
import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

l = []
for i,v in dict(c).items():
    if v > (Q-K):
        l.append(i-1)
for j in range(N):
    if j in l:
        print('Yes')
    else:
        print('No')

Fixed code:
import collections

N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
c = collections.Counter(A)

if (K - Q) > 0:
    for _ in range(N):
        print('Yes')
else:
    l = ['No'] * N
    for i,v in dict(c).items():
        if v >(Q - K):
            l[i-1] = 'Yes'
    for j in l:
        print(j)
Buggy code:
n,k,q = map(int,input().split())
ans_list =[]
point = []
for i in range(n):
  point.append(k)
#print(point)      
for j in range(q):
  ans_list.append(int(input()))
#print(ans_list)
for k in ans_list:
  point[k] += 1
for l in range(n):
  point[l] -= q
  if point[l]>0:
    print("Yes")
  else:
    print("No")
#print(point)

Fixed code:
n,k,q = map(int,input().split())
ans_list =[]
point = []
for i in range(n):
  point.append(k)
#print(point)      
for j in range(q):
  ans_list.append(int(input()))
#print(ans_list)
for k in ans_list:
  point[k-1] += 1
#print(point)
for l in range(n):
  point[l] -= q
  if point[l]>0:
    print("Yes")
  else:
    print("No")
#print(point)
Buggy code:

n,k,q=map(int, input().split())
a=[int(input()) for i in range(q)]

c = collections.Counter(a)

for i in range(1,n+1):
    if k-q+c[i]>=1:
        print('Yes')
    else:
        print('No')

Fixed code:
import collections

n,k,q=map(int, input().split())
a=[int(input()) for i in range(q)]

c = collections.Counter(a)

for i in range(1,n+1):
    if k-q+c[i]>=1:
        print('Yes')
    else:
        print('No')
Buggy code:
n, k, q  = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(int(input()))
 
point = [0]*n
for i in range(q):
    point[a[i]-1] += 1
    print([a[i]-1])

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

Fixed code:
n, k, q  = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(int(input()))
 
point = [0]*n
for i in range(q):
    point[a[i]-1] += 1

for i in range(n):
    if k-(q-point[i]) > 0:
        print("Yes")
    else:
        print("No")
Buggy code:
n,k,q = map(int,input().split())
a = [0 for  _ in range(q)]
point = [k for _ in range(n)]
for i in range(q):
    a[i] = int(input())
for i in range(q):
    for j in range(len(point)):
        point[j] -= 1
    point[a[i]-1] += 1
for i in range(n):
    if(point[i] > 0):
        print("Yes")
    else:
        print("No")
print(point)

Fixed code:
n,k,q = map(int,input().split())
a = [0 for  _ in range(q)]
point = [0 for _ in range(n)]

for i in range(q):
    a[i] = int(input())

for i in range(q):
    point[a[i]-1] += 1

for i in range(n):
    if(point[i] > q-k):
        print("Yes")
    else:
        print("No")
Buggy code:
n, k, q = (int(i) for i in input().split())

score = [0] * n

for i in range(q):
    score[int(input())-1] += 1
print(score)
for i in range(n):
    if score[i] <= q - k:
        print("No")
    else:
        print("Yes")


Fixed code:
n, k, q = (int(i) for i in input().split())

score = [0] * n

for i in range(q):
    score[int(input())-1] += 1
for i in range(n):
    if score[i] <= q - k:
        print("No")
    else:
        print("Yes")
Buggy code:
N,K,Q = map(int,input().split(" "))
ans=np.full(N, K)


ans = [K - Q for i in range(N)]


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

for a in ans:
    if a > 0:
        print("Yes")
    else:
        print("No")

Fixed code:

N,K,Q = map(int,input().split(" "))


ans = [K - Q for i in range(N)]


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

for a in ans:
    if a > 0:
        print("Yes")
    else:
        print("No")
Buggy code:
n, k, q = map(int, input().split())
candis = [k] * n
candis = list(map(lambda x: x - q, candis))
for _ in range(q):
    candis[int(input()) - 1] += 1
print(candis)
for score in candis:
    if score <= 0:
        print("No")
    else:
        print("Yes")


Fixed code:
n, k, q = map(int, input().split())
candis = [k] * n
candis = list(map(lambda x: x - q, candis))
for _ in range(q):
    candis[int(input()) - 1] += 1
for score in candis:
    if score <= 0:
        print("No")
    else:
        print("Yes")
Buggy code:
from collections import defaultdict


def main():
    N, K, Q = map(int, input().split())
    d = defaultdict(int)
    for i in range(Q):
        a = int(input())
        d[a-1] += 1
    print(d)
    for i in range(N):
        if Q - d[i] < K:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()


Fixed code:
from collections import defaultdict


def main():
    N, K, Q = map(int, input().split())
    d = defaultdict(int)
    for i in range(Q):
        a = int(input())
        d[a-1] += 1

    for i in range(N):
        if Q - d[i] < K:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()
Buggy code:
import numpy as np
n,k,q = map(int, input().split())
a = [int(input()) for i in range(q)]
#cnt = [0 for _ in range(n)]
win = [0 for _ in range(n)]
#p = np.array([k for _ in range(n)])
for ai in a:
  win[ai-1] += 1
print(win)

for w in win:
  if k-q+w<=0: print('No')
  else: print('Yes')

Fixed code:
import numpy as np
n,k,q = map(int, input().split())
a = [int(input()) for i in range(q)]
#cnt = [0 for _ in range(n)]
win = [0 for _ in range(n)]
#p = np.array([k for _ in range(n)])
for ai in a:
  win[ai-1] += 1
#print(win)

for w in win:
  if k-q+w<=0: print('No')
  else: print('Yes')
Buggy code:
L1 = input().split(" ")
score = [int(L1[1])-int(L1[2])]*(int(L1[0])-1)
for i in range(int(L1[2])):
    A = int(input()) - 1
    score[A] += 1

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

Fixed code:
L1 = input().split(" ")
L12 = int(L1[2])
score = [int(L1[1])-L12]*(int(L1[0]))
for i in range(L12):
    A = int(input()) - 1
    score[A] += 1

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