Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
lis = []

for a in range(1, int(n**0.5)):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))

Fixed submission:
n = int(input())
lis = []

for a in range(1, int(n**0.5)+1):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = []

for a in range(1, n+1):
  if n % a == 0:
    if len(str(a)) <= len(str(int(n/a))):
      lis.append(max(a, int(n/a)))
    else:
      break

print(len(str(min(lis))))

Fixed submission:
n = int(input())
lis = []

for a in range(1, int(n**0.5)+1):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
power = 1

for x in range(1, n+1):
  power = power * x
  
print(power % (10**9+7))

Fixed submission:
power = 1
x = int(input())
for a in range(1, x + 1):
  power = (power * a) % (10**9 + 7)

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())

power = 1
for n in range(1, num+1):
  power = power * n


power = power % (10 ** 9 + 7)
print(power)

Fixed submission:
power = 1
x = int(input())
for a in range(1, x + 1):
  power = (power * a) % (10**9 + 7)

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
power = 1
x = int(input())
for a in range(1, x + 1):
  power = power * a
  
power = power % (10**9 + 7)
print(power)

Fixed submission:
power = 1
x = int(input())
for a in range(1, x + 1):
  power = (power * a) % (10**9 + 7)

print(power)

Buggy python submission (verdict: Time Limit Exceeded):
power = 1
x = int(input())
for a in range(1, x + 1):
  power = power * a
  
print(power % (10 ** 9 + 7))

Fixed submission:
power = 1
x = int(input())
for a in range(1, x + 1):
  power = (power * a) % (10**9 + 7)

print(power)
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
k, s = map(int, input().split())
count = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x -y
    if z >= 0 and z <= k:
      count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = input().split(" ")
count = 0

for x in range(int(k)+1):
  for y in range(int(k)+1):
    z = int(s) - x -y
    if z >= 0 and z <= int(k):
      count += 1

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x -y
    if z >= 0 and z <= k:
      count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = input().split(" ")
count = 0

for x in range(int(k)+1):
  for y in range(int(k)+1):
    for z in range(int(k)+1):
      a = x + y + z
      if int(s) == a:
        count += 1

print(count)

Fixed submission:
k, s = map(int, input().split())
count = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x -y
    if z >= 0 and z <= k:
      count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
q

Fixed submission:
w = input()
lis = []
for a in set(w):
  b = w.count(a)
  if b % 2 == 1:
    print("No")
    break
  else:
    lis.append(b)
if len(lis) == len(set(w)):
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
while True:
    s = str(n)
    poss = False
    for i in s:
        if int(i) in a:
            poss = True
            break
    if not poss:
        print(n)
        exit(0)
    n += 1

Fixed submission:
a,b,c = map(int, input().split())
if a*b*c==5*5*7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
mod = 10 ** 9 + 7
for i in range(n):
    for j in range(i+1, n):
        ans += a[i] * a[j]
        ans %= mod
print(ans)


Fixed submission:
from itertools import accumulate

n = int(input())
a = list(map(int, input().split()))

# 累積和
a_acm = list(accumulate(a[::-1]))

ans = 0
mod = 10 ** 9 + 7
for i in range(n-1):
    ans += a[i] * a_acm[n-2-i]
    ans %= mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_tmp = [0] + list(itertools.accumulate(a))
b_tmp = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    for j in range(m+1):
        if a_tmp[i]+b_tmp[j] <= k:
            ans = max(ans, i+j)
        else:
            break
print(ans)


Fixed submission:
import itertools
import bisect
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_acc = [0] + list(itertools.accumulate(a))
b_acc = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    if k - a_acc[i] >= 0:
        ans = max(ans, i + bisect.bisect(b_acc, k - a_acc[i])-1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_tmp = [0] + list(itertools.accumulate(a))
b_tmp = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    for j in range(m+1):
        if a_tmp[i]+b_tmp[j] <= k:
            ans = max(ans, i+j)
print(ans)


Fixed submission:
import itertools
import bisect
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_acc = [0] + list(itertools.accumulate(a))
b_acc = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    if k - a_acc[i] >= 0:
        ans = max(ans, i + bisect.bisect(b_acc, k - a_acc[i])-1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_tmp = [0] + list(itertools.accumulate(a))
b_tmp = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    for j in range(m+1):
        if a_tmp[i]+b_tmp[j] <= k:
            ans = max(ans, i+j)
print(ans)


Fixed submission:
import itertools
import bisect
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

a_acc = [0] + list(itertools.accumulate(a))
b_acc = [0] + list(itertools.accumulate(b))
ans = 0

for i in range(n+1):
    if k - a_acc[i] >= 0:
        ans = max(ans, i + bisect.bisect(b_acc, k - a_acc[i])-1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]
for i in range(Q):
    for j in range(N):
        if A[j] == BC[i][0]:
            A[j] = BC[i][1]
    print(sum(A))

Fixed submission:
import collections

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

cnt_list = collections.Counter(A)
total = sum(A)
for i in range(Q):
    cnt_list[BC[i][1]] += cnt_list[BC[i][0]]
    total += (BC[i][1] - BC[i][0]) * cnt_list[BC[i][0]]
    cnt_list[BC[i][0]] = 0
    print(total)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
if a.count(0) > 0:
    print(0)
    exit()
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = ''
if s[0] == '?':
    if s[1] == 'D':
        t = 'P'
    else:
        t = 'D'
else:
    t = s[0]
for i in range(1, len(s)):
    if s[i] == '?':
        if t[-1] == 'P':
            t += 'D'
        else:
            t += 'P'
    else:
        t += s[i]
print(t)


Fixed submission:
s = input()
t = ''
for i in range(0, len(s)):
    if s[i] == '?':
        t += 'D'
    else:
        t += s[i]
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())


def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b


ans = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            ans += gcd(gcd(i, j), k)
print(ans)


Fixed submission:
n = int(input())


def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b


ans = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            ans += gcd(gcd(i, j), k)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            break
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)


Fixed submission:
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            continue
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            continue
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)

Fixed submission:
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            continue
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(input())
S = input()

perm = list(combinations(range(N), 3))
ans = 0
for i in range(len(perm)):
    a1 = perm[i][0]
    a2 = perm[i][1]
    a3 = perm[i][2]
    if a3-a2 == a2 - a1:
        continue
    if len(set([S[a1], S[a2], S[a3]])) == 3:
        ans += 1
print(ans)


Fixed submission:
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            continue
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(input())
S = input()

perm = list(combinations(range(N), 3))
ans = 0
for i in range(len(perm)):
    a1 = perm[i][0]
    a2 = perm[i][1]
    a3 = perm[i][2]
    if a3-a2 == a2 - a1:
        continue
    if len(set([S[a1], S[a2], S[a3]])) == 3:
        ans += 1
print(ans)


Fixed submission:
N = int(input())
S = input()

r = S.count('R')
g = S.count('G')
b = S.count('B')
sum_rgb = r*g*b

# rgbの組み合わせの総数から距離が等しいものを引く
for i in range(N-2):
    for j in range(i+1, N-1):
        k = j + (j-i)
        if k > N-1:
            continue
        if len(set([S[i], S[j], S[k]])) == 3:
            sum_rgb -= 1
print(sum_rgb)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict


def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod


N = int(input())
A = list(map(int, input().split()))

dd = defaultdict(int)

for i in range(N):
    dd[A[i]] += 1

count = 0
for k, v in dd.items():
    if v >= 2:
        count += nCr(v, 2)
for i in range(N):
    if dd[A[i]] >= 3:
        ans = count - nCr(dd[A[i]], 2) + nCr(dd[A[i]]-1, 2)
    elif dd[A[i]] == 2:
        ans = count - nCr(dd[A[i]], 2)
    else:
        ans = count
    print(ans)


Fixed submission:
from collections import defaultdict


def calc(x):
    return x*(x-1)//2


N = int(input())
A = list(map(int, input().split()))

dd = defaultdict(int)
for i in range(N):
    dd[A[i]] += 1

count = 0
for k, v in dd.items():
    if v >= 2:
        count += calc(v)
for i in range(N):
    ans = 0
    if dd[A[i]] >= 3:
        ans = count - calc(dd[A[i]]) + calc(dd[A[i]]-1)
    elif dd[A[i]] == 2:
        ans = count - 1
    elif dd[A[i]] == 1:
        ans = count
    print(ans)
Buggy python submission (verdict: Runtime Error):
from math import pow
a, b, c = map(int, input().split())
mod = 10**9+7
if 4*a*b < pow(c-a-b, 2, mod):
    print('Yes')
else:
    print('No')


Fixed submission:
a, b, c = map(int, input().split())
if (c-a-b) ** 2 - 4*a*b > 0 and c-a-b > 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
max_p = 0
ans_index = 0

total = [0]
for i in range(1, 20000):
    total.append(total[i-1]+i)

for i in range(n-k+1):
    tmp = sum(p[i:i+k])
    if tmp > max_p:
        max_p = tmp
        ans_index = i
ans = 0
for i in range(k):
    ans += total[p[ans_index+i]] / p[ans_index+i]
print(ans)


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

total = [0]
for i in range(1, 200000):
    total.append(total[i-1]+i)

ans_index = 0
cur = sum(p[0:k])
max_p = cur
for i in range(n-k+1):
    cur = cur + p[i+k-1] - p[i-1]
    if cur > max_p:
        max_p = cur
        ans_index = i
ans = 0
for i in range(k):
    ans += total[p[ans_index+i]] / p[ans_index+i]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = [[0]*10 for _ in range(n)]
ans = 0
for i in range(1, n+1):
    s = str(i)
    if s[0] == '0' or s[-1] == '0':
        continue
    d[int(s[0])][int(s[-1])] += 1
for i in range(1, 10):
    for j in range(1, 10):
        ans += d[i][j] * d[j][i]
print(ans)


Fixed submission:
n = int(input())
d = [[0]*10 for _ in range(10)]
ans = 0
for i in range(1, n+1):
    s = str(i)
    if s[0] == '0' or s[-1] == '0':
        continue
    d[int(s[0])][int(s[-1])] += 1
for i in range(1, 10):
    for j in range(1, 10):
        ans += d[i][j] * d[j][i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]
 
a = []
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] not in a:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            a.append(ps[i][0])
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)

Fixed submission:
n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]

ps = sorted(ps, key=lambda x: x[0])

flag = 0
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] != flag:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            flag = ps[i][0]
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]

a = []
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] not in a:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            a.append(ps[i][0])
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)

Fixed submission:
n, m = map(int, input().split())
ps = [input().split() for _ in range(m)]

ps = sorted(ps, key=lambda x: x[0])

flag = 0
wa = {}
AC_count = 0
WA_count = 0
for i in range(m):
    if ps[i][0] != flag:
        if ps[i][1] == 'AC':
            AC_count += 1
            if ps[i][0] in wa.keys():
                WA_count += wa[ps[i][0]]
            flag = ps[i][0]
        else:
            if ps[i][0] in wa.keys():
                wa[ps[i][0]] += 1
            else:
                wa[ps[i][0]] = 1
print(AC_count, WA_count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
st = [input().split() for _ in range(n)]
x = input()
flag = False
ans = 0
for s, t in st:
    if flag:
        ans += int(t)
    if s == x:
        flag = True
print(ans

Fixed submission:
n = int(input())
st = [input().split() for _ in range(n)]
x = input()
flag = False
ans = 0
for s, t in st:
    if flag:
        ans += int(t)
    if s == x:
        flag = True
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools


def xORSum(arr, n):
    ans = 0
    for i in range(0, n):
        for j in range(i + 1, n):
            ans = ans + (arr[i] ^ arr[j])
    return ans


n = int(input())
a = list(map(int, input().split()))

print(xORSum(a, n) % (10**9+7))


Fixed submission:
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
mod = 10**9+7

ans = 0
max_digit = 0
for i in range(n):
    max_digit = max(max_digit, len(bin(a[i])))
for i in range(max_digit):
    num1 = np.count_nonzero((a >> i) & 1)  # 1の数
    num2 = n - num1  # 0の数
    ans += pow(2, i, mod) * (num1 * num2) % mod
print(ans % mod)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)

Fixed submission:
a, b = map(int, input().split())

if 1 <= a <= 9 and 1 <= b <= 9:
    print(a*b)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if L[k] < L[i]+L[j]:
                ans += 1
            else:
                break
print(ans)

Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        idx = bisect.bisect_left(L, L[i] + L[j])
        ans += max(0, idx - j - 1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if L[i] < L[j] + L[k] and L[j] < L[k]+L[i] and L[k] < L[i]+L[j]:
                ans += 1
            else:
                break
print(ans)

Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        idx = bisect.bisect_left(L, L[i] + L[j])
        ans += max(0, idx - j - 1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if L[i] < L[j] + L[k] and L[j] < L[k]+L[i] and L[k] < L[i]+L[j]:
                ans += 1
            else:
                break
print(ans)

Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        idx = bisect.bisect_left(L, L[i] + L[j])
        ans += max(0, idx - j - 1)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
L = list(map(int, input().split()))

ans = 0
for a, b, c in itertools.combinations(L, 3):
    if a < b + c and b < c+a and c < a+b:
        ans += 1
print(ans)

Fixed submission:
import bisect

n = int(input())
L = list(map(int, input().split()))

ans = 0
L.sort()

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        idx = bisect.bisect_left(L, L[i] + L[j])
        ans += max(0, idx - j - 1)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append([i, a[i]])
b = sorted(b, key=lambda x: x[1])
c = []
for k, v in b:
    c.append(k+1)
print(' '.join(map(str, c))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append([i, a[i]])
b = sorted(b, key=lambda x: x[1])
c = []
for k, v in b:
    c.append(k+1)
print(' '.join(map(str, c)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(1, n+1):
    for j in range(0, n):
        if a[j] == i:
            ans.append(j+1)
print(' '.join(map(str, ans)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append([i, a[i]])
b = sorted(b, key=lambda x: x[1])
c = []
for k, v in b:
    c.append(k+1)
print(' '.join(map(str, c)))
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
a = [int(input()) for _ in range(Q)]

count = []
for i in range(N):
    count.append(K)

for i in range(Q):
    for j in range(N):
        if j+1 != a[i]:
            count[j] = count[j] - 1
for i in range(N):
    if count[i] <= 0:
        print('No')
    else:
        print('Yes')


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

count = []
for i in range(N):
    count.append(K-Q)

for i in range(Q):
    count[a[i]-1] += 1
for i in range(N):
    if count[i] <= 0:
        print('No')
    else:
        print('Yes')