Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = []

for i in range(1, n + 1):
  cnt = 0
  for x in range(1, 41):
    for y in range(x, 41):
      for z in range(y, 100):
        if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == i * 2:
          if x != y and y != z and z != x:
            cnt += 6
          elif x == y == z:
            cnt += 1
          else:
            cnt += 3
  ans.append(cnt)
for j in range(n):
  print(ans[j])

Fixed submission:
n = int(input())
ans = [0] * n

cnt = 0
for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      f = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
      if f <= n:
        ans[f - 1] += 1
ans.append(cnt)

for j in range(n):
  print(ans[j])

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

for i in range(1, n + 1):
  cnt = 0
  for x in range(1, n):
    for y in range(x, n):
      for z in range(y, n):
        if (x + y) ** 2 + (y + z) ** 2 + (z + x) ** 2 == i * 2:
          if (x == y and y != z) or (x != y and y == z):
            cnt += 3
          elif x == y == z:
            cnt += 1
          else:
            cnt += 6
  ans.append(cnt)
for i in range(n):
  print(ans[i])

Fixed submission:
n = int(input())
ans = [0] * n

cnt = 0
for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1, 100):
      f = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
      if f <= n:
        ans[f - 1] += 1
ans.append(cnt)

for j in range(n):
  print(ans[j])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def num_div(n):
  num_div_n = 0
  for i in range(1, int(n**0.5) + 1):
    if n % i == 0:
      num_div_n += 2
      if n // i == i:
        num_div_n -= 1
        
  return num_div_n

sum_div = 0
for i in range(n):
  sum_div += (i + 1) * num_div(i + 1)
  
print(sum_div)
  

Fixed submission:
def g(x, n): #g(x, n): xの倍数(< n)の和
  y = n // x
  return x * y * (y + 1) // 2

n = int(input())

sum = 0
for i in range(1, n + 1):
  k = n // i
  sum += g(i, n)
  
print(sum)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
l=[]

p.sort()

for i in range(K+1):
  l.append(p[i])
print(sum(l))



Fixed submission:
N,K=map(int,input().split())
p=list(map(int,input().split()))
l=[]

p.sort()

for i in range(K):
  l.append(p[i])
print(sum(l))
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))

for i in x:
    if x[i]==0:
        print(i+1)

Fixed submission:
a,b,c,d,e=map(str,input().split())

s=str(a+b+c+d+e)

print(s.find('0')+1)
Buggy python submission (verdict: Runtime Error):
N=int(input())

for i in range(N):
  ans*=int(input())
  if ans>10**18:
    break
    print(-1)

print(ans)


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

if 0 in a:
  print(0)

else:
  ans = 1
  for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      exit()
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math

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

if 0 not in A:
  for i in A:
    l.append(math.log10(A[i]))
  if sum(l)<18: 
    print(int(10**sum(l)))
  else:
    print(str(-1))
else:
  print(str(0))


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

if 0 in a:
  print(0)

else:
  ans = 1
  for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      exit()
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math

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

if 0 not in A:
  for i in A:
  l.append(math.log10(A[i]))
  if sum(l)<18: 
    print(int(10**sum(l)))
  else:
    print(‘-1’)
else:
  print(‘0’)

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

if 0 in a:
  print(0)

else:
  ans = 1
  for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      exit()
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math

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

for i in A:
  l.append(math.log10(A[i]))
  
if sum(l)<18:
  print(int(10**sum(l)))
else:
  print(-1)

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

if 0 in a:
  print(0)

else:
  ans = 1
  for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      exit()
  print(ans)

Buggy python submission (verdict: Runtime Error):
import.math

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

for _ in A:
  l.append(math.log10(A))
  
if sum(l)<18:
  print(math.exp(sum(l)))
else:
  print(-1)

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

if 0 in a:
  print(0)

else:
  ans = 1
  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()

if S[1]==B:
  print('ARC')
else:
  print('ABC')

Fixed submission:
S=input()

if S[1]=='B':
  print('ARC')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
H=list(map(int,input().split()))
P=[]
for i in range(M):
    P.append(list(map(int,input().split()))) #2次元配列、P[A_i,B_i]

ans=[]

for i in range(M):
    if H[P[i][0]-1]>H[P[i][1]-1]:   #H[A_i]>H[B_i]ならばA_iを加える
        ans.append([P[i][0])
    elif H[P[i][0]-1]<H[P[i][1]-1]: #H[A_i]<H[B_i]ならばB_iを加える
        ans.append(P[i][1])       
    else:                           #H[A_i]=H[B_i]ならば何もしない
        continue                    
    
list=[]

for j in range(M): 
    list+=P[j]

print(len(set(ans))+N-len(set(list)))

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

bad = []
for i in range(m):
  if h[l[i][0] - 1] > h[l[i][1] - 1]:
    bad.append(l[i][1])
  elif h[l[i][0] - 1] < h[l[i][1] - 1]:
    bad.append(l[i][0])
  else:
    bad.append(l[i][0])
    bad.append(l[i][1])

print(n - len(set(bad)))

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
H=list(map(int,input().split()))
P=[]
for i in range(M):
    P.append(list(map(int,input().split())))

ans=[]

for i in range(M):
  if H[P[i][0]-1]>H[P[i][1]-1]:
    ans.append(H[P[i][0]])
  elif H[P[i][0]-1]<H[P[i][1]-1]:
    ans.append(H[P[i][1]-1])
  else:
    continue
    
list=[]

for j in range(M): 
    list+=P[j]

print(len(set(ans))+N-len(set(list)))

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

bad = []
for i in range(m):
  if h[l[i][0] - 1] > h[l[i][1] - 1]:
    bad.append(l[i][1])
  elif h[l[i][0] - 1] < h[l[i][1] - 1]:
    bad.append(l[i][0])
  else:
    bad.append(l[i][0])
    bad.append(l[i][1])

print(n - len(set(bad)))
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())

for i in range(1,1001):
  n==k*i
  if a<=n<=b:
    print('OK')
    exit()
  else:
    continue

print('NG')




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

for i in range(1,1001):
  n=k*i
  if a<=n<=b:
    print('OK')
    exit()
  else:
    continue

print('NG')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
l = []

for i in range(1, n + 1):
    cnt = 0
    for j in range(n - 1):
        if i == a[j]:
            cnt += 1
    l.append(cnt)
            
for k in range(n):
    print(l[k])


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in a:
    l[i - 1] += 1
    
for k in range(n):
    print(l[k])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
l = []

for i in range(1, n + 1):
    cnt = 0
    for j in range(n - 1):
        if i == a[j]:
            cnt += 1
    l.append(cnt)
            
for k in range(n):
    print(l[k])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
l = [0] * n

for i in a:
    l[i - 1] += 1
    
for k in range(n):
    print(l[k])
Buggy python submission (verdict: Runtime Error):
from math import gcd

k = int(input())
gcd_sum = 0

for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            gcd_sum += gcd(a, b, c)

print(gcd_sum)



Fixed submission:
from math import gcd

k = int(input())
ans = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        gcd_ab = gcd(a, b)
        for c in range(1, k + 1):
            ans += gcd(gcd_ab, c)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

k = int(input())
gcd_sum = 0

for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            gcd_sum += gcd(a, b, c)
print(gcd_sum)

Fixed submission:
from math import gcd

k = int(input())
ans = 0
for a in range(1, k + 1):
    for b in range(1, k + 1):
        gcd_ab = gcd(a, b)
        for c in range(1, k + 1):
            ans += gcd(gcd_ab, c)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = s[::-1]
n = len(s)
a = s[:(N - 1) // 2]
b = t[:(n + 3) // 2]

if s == t and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
t = s[::-1]
n = len(s)
a = s[:(n - 1) // 2]
b = t[:(n - 1) // 2]

if s == t and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
t = s[::-1]
n = len(S)
a = s[:(N - 1) // 2]
b = t[:(n + 3) // 2]

if s == t and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
t = s[::-1]
n = len(s)
a = s[:(n - 1) // 2]
b = t[:(n - 1) // 2]

if s == t and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

red = [0] * a
blue = [1] * b
l = []

while len(l) < n:
    l += red
    l += blue
m = l[:n]
print(m.count(0))

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

if a == 0:
    print(0)
elif n >= a + b:
    if n % (a + b) <= a:
        print(a * (n // (a + b)) + (n % (a + b)))
    else:
        print(a * (n // (a + b)) + a)
        
else:
    if n < a:
        print(n)
    else:
        print(a)
Buggy python submission (verdict: Runtime Error):
n, r = map(int, input().split())

if n >= 10 :
  pint(r)
else:
  print(r - 100 * (10 - n))

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

if n >= 10 :
  print(r)
else:
  print(r + 100 * (10 - n))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for _ in range(n)]

d = {}
for i in s:
    if i not in d:
        d[i] = 1
    else:
        d[i] += 1

l = []
for k in d.keys():
    if d[k] == max(d.values()):
        l.append(k)

l_s = sorted(l)
                
for ans in l_s:
    print(ans)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]

d = {}
for i in s:
    if i not in d:
        d[i] = 1
    else:
        d[i] += 1
        
m = max(d.values())

l = []
for k in d.keys():
    if d[k] == m:
        l.append(k)

l_s = sorted(l)
                
for ans in l_s:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for _ in range(n)]

d = {}
for i in s:
    if i not in d:
        d[i] = 1
    else:
        d[i] += 1

l = []
for k in d.keys():
    if d[k] == max(d.values()):
        l.append(k)
        
for ans in sorted(l):
    print(ans)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]

d = {}
for i in s:
    if i not in d:
        d[i] = 1
    else:
        d[i] += 1
        
m = max(d.values())

l = []
for k in d.keys():
    if d[k] == m:
        l.append(k)

l_s = sorted(l)
                
for ans in l_s:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
  if min(p[: i + 1]) == p[i]:
    ans += 1
    
print(ans)

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

tmp_min = p[0]
cnt = 0

for i in range(n):
    if p[i] <= tmp_min:
        tmp_min = p[i] #i番目までの最小値を更新
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
  if min(p[: i + 1]) >= p[i]:
    ans += 1
    
print(ans)

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

tmp_min = p[0]
cnt = 0

for i in range(n):
    if p[i] <= tmp_min:
        tmp_min = p[i] #i番目までの最小値を更新
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
  if all(e >= p[i] for e in p[: i + 1]):
    ans += 1
    
print(ans)

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

tmp_min = p[0]
cnt = 0

for i in range(n):
    if p[i] <= tmp_min:
        tmp_min = p[i] #i番目までの最小値を更新
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
  if all(e >= p[i] for e in p[: i + 1]):
    ans += 1
    
print(ans)

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

tmp_min = p[0]
cnt = 0

for i in range(n):
    if p[i] <= tmp_min:
        tmp_min = p[i] #i番目までの最小値を更新
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

ans = 0
for i in range(n):
  cnt = 0
  for j in range(i):
    if p[i] > p[j]:
      cnt += 1
  if cnt == 0:
    ans += 1
  
print(ans)  

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

tmp_min = p[0]
cnt = 0

for i in range(n):
    if p[i] <= tmp_min:
        tmp_min = p[i] #i番目までの最小値を更新
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
cnt = 0

for i in range(0, N-1):
    if S[i] == 'A' and S[i + 1] == 'B' and S[i + 2] == 'C':
        cnt += 1
print(cnt)

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

for i in range(N):
    if S[i] == 'C' and S[i - 1] == 'B' and S[i - 2] == 'A':
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()

cnt=0

for i in range(N-1):
    if S[i]=='A' and S[i+1]=='B' and S[i+2]=='C':
        cnt+=1
print(cnt)

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

for i in range(N):
    if S[i] == 'C' and S[i - 1] == 'B' and S[i - 2] == 'A':
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())

list=[]

for i in range(N-1):
    if S[i]=='A' and S[i+1]=='B' and S[i+2]=='C':
        list.append(i)
print(len(list))

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

for i in range(N):
    if S[i] == 'C' and S[i - 1] == 'B' and S[i - 2] == 'A':
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())

list=[]

for i in range(N-1):
    if S[i]=='A' and S[i+1]=='B' and S[i+2]=='C':
        list.append(i)
print(len(list))

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

for i in range(N):
    if S[i] == 'C' and S[i - 1] == 'B' and S[i - 2] == 'A':
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

l=set(itertools.combinations(S, 3))

print(len(l))

Fixed submission:
N=int(input())
S=input()
cnt=0
 
for i in range(10):
    a=S.find(str(i))
    if a==-1:
        continue
    for j in range(10):
        b=S.find(str(j),a+1)
        if b==-1:
            continue
        for k in range(10):
            if S.find(str(k),b+1)!=-1:
                cnt+=1
print(cnt)

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

N=int(input())
S=input()
a,b,c=0,0,0

l=set(itertools.combinations(S, 3))

print(len(l))


Fixed submission:
N=int(input())
S=input()
cnt=0
 
for i in range(10):
    a=S.find(str(i))
    if a==-1:
        continue
    for j in range(10):
        b=S.find(str(j),a+1)
        if b==-1:
            continue
        for k in range(10):
            if S.find(str(k),b+1)!=-1:
                cnt+=1
print(cnt)

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

N=int(input())
S=input()
a,b,c=0,0,0

l=set(itertools.combinations(S, 3))

print(len(l))

Fixed submission:
N=int(input())
S=input()
cnt=0
 
for i in range(10):
    a=S.find(str(i))
    if a==-1:
        continue
    for j in range(10):
        b=S.find(str(j),a+1)
        if b==-1:
            continue
        for k in range(10):
            if S.find(str(k),b+1)!=-1:
                cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
import itertools

N=int(input())
S=input

print(len(list(itertools.combinations_with_replacement(S, 3))) 

Fixed submission:
N=int(input())
S=input()
cnt=0
 
for i in range(10):
    a=S.find(str(i))
    if a==-1:
        continue
    for j in range(10):
        b=S.find(str(j),a+1)
        if b==-1:
            continue
        for k in range(10):
            if S.find(str(k),b+1)!=-1:
                cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import itertools

n = int(input())
x = [list(map(int, input().split())) for _ in range(n)]

r = 1
for i in range(n):
    r *= i + 1

d = []
for j in range(n - 1):
    for k in range(j + 1, n):
        d.append(((x[j][0] - x[k][0]) ** 2 + (x[j][1] - x[k][1]) ** 2) ** 0.5 / r)

p = list(itertools.permutations(d, n - 1))

ans = []
for l in range(r):
    ans.append(sum(list(p[l])))
        
print(sum(ans))

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

d = 0
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        d += ((x[i][0] - x[j][0]) ** 2 + (x[i][1] - x[j][1]) ** 2) ** 0.5
        cnt += 1

print(d * (n - 1) / cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = ''
for i in range(n):
  ans += str(a.index(i + 1) + 1) + ' '
  
print(ans)

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

ans = [0] * n
for i in range(n):
  ans[a[i] - 1] = i + 1
  
print(' '.join(map(str, ans)))

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

ans = ''
for i in range(n):
  ans += str(a.index(i + 1) + 1) + ' '
  
print(ans)

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

ans = [0] * n
for i in range(n):
  ans[a[i] - 1] = i + 1
  
print(' '.join(map(str, ans)))

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

ans = []
for i in range(n):
  ans.append(str(a.index(i + 1) + 1))
  
print(' '.join(ans))

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

ans = [0] * n
for i in range(n):
  ans[a[i] - 1] = i + 1
  
print(' '.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = sorted([0] + list(int(input()) for _ in range(q)))
p = [k - q] * (n + 1)

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

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [0] + list(int(input()) for _ in range(q))
p = [0]

a = sorted(a)

for i in range(1, n + 1):
    p.append(a.count(i))
    
for j in range(1, n + 1):
    if k - (q - p[j]) > 0:
        print('Yes')
    else:
        print('No')   

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = sorted([0] + list(int(input()) for _ in range(q)))
p = [0]

for i in range(1, n + 1):
    p.append(a.count(i))
    
for j in range(1, n + 1):
    if k - (q - p[j]) > 0:
        print('Yes')
    else:
        print('No')   

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [0] + list(int(input()) for _ in range(q))
p = [k] * (n + 1)

def point_counter(x):
    return x - 1

for i in range(1, q + 1):
    p = list(map(point_counter, p))
    p[a[i]] += 1
    
for j in range(1, n + 1):
    if p[j] > 0:
        print('Yes')
    else:
        print('No')   

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [0] + list(int(input()) for _ in range(q))
p = [k] * (n + 1)

def point_counter(x):
    return x - 1

for i in range(1, q + 1):
    p = list(map(point_counter, p))
    p[a[i]] += 1
    
for j in range(1, n + 1):
    if p[j] > 0:
        print('Yes')
    else:
        print('No')   

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

for i in range(1, q + 1):
    p[a[i]] += 1
    
for j in range(1, n + 1):
    if p[j] > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = sorted(map(int, input().split()))

ans = v[0]

for i in range(1, N):
    ans = (ans + v[i]) / 2

print(ans)

Fixed submission:
n = int(input())
v = sorted(map(int, input().split()))

ans = v[0]

for i in range(1, n):
    ans = (ans + v[i]) / 2

print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
l=[]

if N%2==0:
  for i in range(0,N+1,2):
    n=len(str(i))
    if n%2==1:
      l.append(n)
print(len(l))

Else:
  for j in range(1,N+1,2):
    n=len(str(i))
    if n%2==1:
      l.append(n)
print(len(l))
  
  

  

Fixed submission:
N=int(input())
cnt=0

for i in range(1,N+1):
    if len(str(i))%2==1:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
l=[]

for i in range(2,min(A,B)+1):
    if A%i==0 and B%i==0:
        l.append(i)
sorted(l)[::-1]
print(l[K-1])

Fixed submission:
A,B,K=map(int,input().split())
l=[]

for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        l.append(i)
l=sorted(l)[::-1]
print(l[K-1])

Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
l=[]

for i in range(2,min(A,B)+1):
    if A%i==0 and B%i==0:
        l.append(i)
print(sorted(l)[K-1])

Fixed submission:
A,B,K=map(int,input().split())
l=[]

for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        l.append(i)
l=sorted(l)[::-1]
print(l[K-1])