Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
    N=int(input())  #数値入力 「N」だけの入力のとき
    H=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
    ans = 0
    a = 0
    for i in range(N):
        a = 0
        if ans > N-i-1:
            break
        else:
            for j in range(N-i):
                if i+j == N-1:
                    if a > ans:
                        ans = a
                    break
                elif H[i+j] >= H[i+j+1]:
                    a += 1
                else:
                    if a > ans:
                        ans = a
                    break
    print(ans)

if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-

def main():
    s=input()  
    t=input()  
    a = 0
    for i in range(3):
        if s[i] == t[i]:
            a+=1
    print(a)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
    a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    ans = 1
    if b == 1:
        print(0)
        break
    else:
        while(True):
            elif a < b:
                b = b - a
                ans += 1
            else:
                print(ans)
                break     

if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-

def main():
    a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    ans = 1
    if b == 1:
        print(0)
    else:
        while(True):
            if a < b:
                b = b - a + 1
                ans += 1
            else:
                print(ans)
                break     

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = input() 
b = input()

product = a * b
#print(product)

if product % 2:
    print("Odd")
else:
    print("Even")

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())  # list() を使っても構いません

product = a * b
#print(product)

if product % 2:
    print("Odd")
else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
n=input()
if n[len(n)-1]=="s":
  n.append("es")
else:
  n.append("s")
print("".join(n))

Fixed submission:
n=list(input())
if n[len(n)-1]=="s":
  n.append("es")
else:
  n.append("s")
print("".join(n))
Buggy python submission (verdict: Runtime Error):
n=int(inoput())
a=list(map(int,input()))
total=0
for i in range(0,n-1):
  for j in range(1,n):
    total+=a[i]*a[j]
print(total%(10**9+7))
    

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n):
  x+=a[i]
x=x**2
y=0
for j in range(n):
  y+=a[j]**2
z=(x-y)//2
print(z%(10**9+7))
Buggy python submission (verdict: Runtime Error):
n,x,t=map(int,input().split())
s=ceil(n//x)
print(s*t)

Fixed submission:
import math
n,x,t=map(int,input().split())
s=math.ceil(n/x)
print(s*t)
Buggy python submission (verdict: Runtime Error):
H,W,M=map(int,input().split())
row=[0]*H
col=[0]*W
for i in range(M):
    h,w=map(int,input().split())
    row[h-1]+=1
    col[w-1]+=1
A=max(row)
B=max(col)
a=[x for x in range(H) if row[x]==A]
b=[x for x in range(W) if col[x]==B]
cnt=0
for i in a:
    for j in b:
        cnt+=1
        if (i,j) not in target:
            print(A+B)
            exit(0)
        if cnt>M:
            print(A+B-1)
            exit(0)
print(A+B-1)

Fixed submission:
H,W,M=map(int,input().split())
row=[0]*H
col=[0]*W
target=set()
for i in range(M):
    h,w=map(int,input().split())
    row[h-1]+=1
    col[w-1]+=1
    target.add((h-1,w-1))
A=max(row)
B=max(col)
a=[x for x in range(H) if row[x]==A]
b=[x for x in range(W) if col[x]==B]
cnt=0
for i in a:
    for j in b:
        cnt+=1
        if (i,j) not in target:
            print(A+B)
            exit(0)
        if cnt>M:
            print(A+B-1)
            exit(0)
print(A+B-1)
Buggy python submission (verdict: Time Limit Exceeded):
x,k,d=map(int,input().split())
mini=0
l1=x-d
l2=x+d
for i in range(k):
 if abs(l1)<abs(l2):
  mini=abs(l1)
  l1=mini-d
  l2=mini+d
 else:
  mini=abs(l2)
  l1=mini-d
  l2=mini+d
print(mini)

Fixed submission:
x,k,d=map(int,input().split())
mini=0
if abs(x)>=k*d:
 mini=abs(x)-k*d
 print(mini)
else:
 q=abs(x)//d
 s=abs(x)%d
 if (k-q)%2==0:
  print(s)
 else:
  print(abs(s-d))

Buggy python submission (verdict: Time Limit Exceeded):
x,k,d=map(int,input().split())
mini=0
l1=x-d
l2=x+d
for i in range(k):
 if abs(l1)<abs(l2):
  mini=abs(l1)
  l1=mini-d
  l2=mini+d
 else:
  mini=abs(l2)
  l1=mini-d
  l2=mini+d
print(mini)

Fixed submission:
x,k,d=map(int,input().split())
mini=0
if abs(x)>=k*d:
 mini=abs(x)-k*d
 print(mini)
else:
 q=abs(x)//d
 s=abs(x)%d
 if (k-q)%2==0:
  print(s)
 else:
  print(abs(s-d))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  print(a.count(i+1))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0 for _ in range(n)]
for i in range(len(a)):
  c[a[i]-1]+=1
for j in range(len(c)):
  print(c[j])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = [int(i) - 1 for i in input().split()]
c = list(map(int, input().split()))

def mymax(max_variable, candidate):
    if max_variable is None:
        return candidate
    else:
        return max(max_variable, candidate)

max_cost = None
for start in range(n):
    seen = []
    next_ = p[start]
    cost_sum = []
    cost = 0
    while next_ != start:
        seen.append(next_)
        cost += c[next_]
        cost_sum.append(cost)
        next_ = p[next_]

    seen.append(start)
    cost += c[start]
    cost_sum.append(cost)

    l = len(seen)
    s = cost_sum[-1]
    for end in range(len(seen)):
        moves = end + 1
        remain_moves = k - moves
        if remain_moves < 0:
            continue
        cand_cost = cost_sum[end] + max(0, s) * int(remain_moves / l)
        max_cost = mymax(max_cost, cand_cost)
print(max_cost)



Fixed submission:
n, k = map(int, input().split())
p = [int(i) - 1 for i in input().split()]
c = list(map(int, input().split()))

def mymax(max_variable, candidate):
    if max_variable is None:
        return candidate
    else:
        return max(max_variable, candidate)

max_cost = None
for start in range(n):
    seen = []
    next_ = p[start]
    cost_sum = []
    cost = 0
    while next_ != start:
        seen.append(next_)
        cost += c[next_]
        cost_sum.append(cost)
        next_ = p[next_]

    seen.append(start)
    cost += c[start]
    cost_sum.append(cost)

    l = len(seen)
    s = cost_sum[-1]
    for end in range(len(seen)):
        moves = end + 1
        remain_moves = k - moves
        if remain_moves < 0:
            continue
        cand_cost = cost_sum[end] + max(0, s) * int(remain_moves / l)
        max_cost = mymax(max_cost, cand_cost)
print(max_cost)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

# prepare
mul = 1
for i in range(k):
    mul *= a[i]

prev = mul
for i in range(k, n):
    next = prev / a[i - (k)] * a[i]
    if next > prev:
        print('Yes')
    else:
        print('No')
    prev = next

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

for i in range(k, n):
    prev = a[i - k]
    next = a[i]
    if next > prev:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
import math
A, B = [int(i) for i in input().split(' ')]
gcd = math.gcd(A, B)
print(int(A*B/gcd))

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

A, B = [int(i) for i in input().split(' ')]
gcd_ = gcd(A, B)
print(int(A*B/gcd_))
Buggy python submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())

# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
    times.append(math.ceil(math.log2((k / i))))
bottom_max = times[0]
for t in times:
    score += 2 ** (bottom_max - t)
score /= 2 ** (bottom_max) * n

# for big
big = [i for i in range(k, max(k, n + 1))]
score += len(big) / n
print('{:.10f}'.format(score))


Fixed submission:
import math

n, k = map(int, input().split())

# for small
score = 0
times = []
for i in range(1, min(n + 1, k)):
    times.append(math.ceil(math.log2((k / i))))

if len(times):
    bottom_max = times[0]
    for t in times:
        score += 2 ** (bottom_max - t)
    score /= 2 ** (bottom_max) * n

# for big
big = [i for i in range(k, max(k, n + 1))]
score += len(big) / n
print('{:.10f}'.format(score))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x = list(map(int, input().split()))

ans=0
total=0

for i in range(n):
  l=i+1
  for l in range(i+1,n):
   
    ans=ans+x[l]
  total=total+x[i]*ans
  ans=0 
   
    
print(total %1000000007)


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

ans=0
total=0
t=sum(x)

for i in range(n):
 
  t=t-x[i]
  total=total+x[i]*(t)
  
   
    
print(total %1000000007)

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

ans=0

for i in range(n):
  l=i+1
  for l in range(i+1,n):
   
    ans=ans+x[i]*x[l]
    
print(ans%1000000007)
  

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

ans=0
total=0
t=sum(x)

for i in range(n):
 
  t=t-x[i]
  total=total+x[i]*(t)
  
   
    
print(total %1000000007)
Buggy python submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
 
M = max(a,b)  
m = min(a,b)  
  
if (v-w)*t > M - n:
	print('YES')
else:
	print('NO')


Fixed submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
gap=abs(a-b) 
if v>w:
  c=gap/(v-w)
  if t>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
 
M = max(a,b)  
m = min(a,b)  
  
if (v-w)*t > M - n:
  print('YES')
else:
  print('NO')

Fixed submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
gap=abs(a-b) 
if v>w:
  c=gap/(v-w)
  if t>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

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

if v>w:
  c=(b-a)/(v-w)
  if t>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')

Fixed submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
gap=abs(a-b) 
if v>w:
  c=gap/(v-w)
  if t>=c:
    print('YES')
  else:
    print('NO')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
x = list(map(int, input().split()))
if x.count(0) !=0:
  print('0')
else:  
  ans=1
  for i in range(n):
    ans=ans*x[i]
  if ans >10**18:
    print(-1)
  else:
    print(ans)  
    

Fixed submission:
n =int(input())
x = list(map(int, input().split()))
if x.count(0) !=0:
  print('0')
else:  
  ans=x[0]
  for i in range(1,n):
    ans=ans*x[i]
    if ans >10**18:
      print(-1)
      exit()
  print(ans)

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

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

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

for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))


Fixed submission:
n,k=map(int,input().split())
s=[]
for i in range(n):
  s.append(0)


for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=[0,0,0]

for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))

Fixed submission:
n,k=map(int,input().split())
s=[]
for i in range(n):
  s.append(0)


for i in range(k):
  d=int(input())
 
  List=list(map(int,input().split()))
  for i in range(d):
    s[List[i]-1]=1
print(n-sum(s))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n[1]=='7':
  print('Yes')
if n[2]=='7':
   print('Yes')
if n[3]=='7':
   print('Yes')
else:
   print('No')
    

Fixed submission:
n=input()
if n[0]=='7':
  print('Yes') 
elif n[1]=='7':
  print('Yes')  
elif n[2]=='7':
  print('Yes')  
else:
   print('No')

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n[1]=='7':
  print('Yes')
if n[2]=='7':
   print('Yes')
if n[3]=='7':
   print('Yes')
else:
   print('No')

Fixed submission:
n=input()
if n[0]=='7':
  print('Yes') 
elif n[1]=='7':
  print('Yes')  
elif n[2]=='7':
  print('Yes')  
else:
   print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import fractions
total=0
for A in range(1,n+1):
  for B in range(1,n+1):
    for C in range(1,n+1):
      a=[A,B,C]
     
      ans = a[0]
      for i in range(1,3):
        ans=fractions.math.gcd(ans,a[i])
       
      total=total+ans
print(total)  

Fixed submission:
n=int(input())
import fractions
total=0
for A in range(1,n+1):
  for B in range(1,n+1):
    for C in range(1,n+1):
      a=[A,B,C]
     
      ans = a[0]
      for i in range(1,3):
        ans=fractions.math.gcd(ans,a[i])
       
      total=total+ans
print(total)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
amari=n%k
mainasu=n-(n//k+1)*k
if amari<abs(mainasu):
  print(amari)
else:
  print(abs(mainasu))
n,k=map(int,input().split())
amari=n%k
mainasu=n-(n//k+1)*k
if amari<abs(mainasu):
  print(amari)
else:
  print(abs(mainasu))


Fixed submission:
n,k=map(int,input().split())
amari=n%k
mainasu=n-(n//k+1)*k
if amari<abs(mainasu):
  print(amari)
else:
  print(abs(mainasu))
Buggy python submission (verdict: Runtime Error):
S, W = map(int, input().split())
if S > W:
  print("safe")
  else:
    print("unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = input()
W = input()
if S > W:
  print("safe")
else:
  print("unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S > W:
  print("safe")
else:
  print("unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S > W:
  print("safe")
else:
  print("unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S > W:
  print("safe")
 else:
  print("unsafe")


Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S > W print('safe')
else: print('unsafe')

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
print(safe if S > W else unsafe)

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
print('safe' if S > W else 'unsafe')

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if S > W print("safe")
 else print("unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
print("safe" if S > W else "unsafe")

Fixed submission:
S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")
Buggy python submission (verdict: Runtime Error):
if "7" in input()
 print("Yes")
else print("No")

Fixed submission:
N = input()
if "7" in N:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split()
Q = int(input())
b_c = [input().split() for i in range(Q)]

for i in range(Q):
    sum = 0
    A = [j.replace(b_c[i][0], b_c[i][1]) for j in A]
    for j in range(len(A)):
        sum += int(A[j])
    print(sum)

Fixed submission:
from collections import Counter

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

ans = sum(A)
l = Counter(A)
for i in range(Q):
    ans += l[b_c[i][0]] * (b_c[i][1] - b_c[i][0])
    l[b_c[i][1]] += l[b_c[i][0]]
    l[b_c[i][0]] = 0
    print(ans)
Buggy python submission (verdict: Runtime Error):
s = input().split()
print(s.index['0'])

Fixed submission:
s = input().split()
print(s.index('0')+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
f = 0
for i in range(len(A)):
    check = False
    for j in range(len(A)):
        if i == j:
            continue
        else:
            if A[i] % A[j] == 0:
                check = True
                break
    if check == True:
        f += 1
ans = len(A) - f
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))
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:
    ans = -1
print(ans)

Fixed submission:
import sys
N = int(input())
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print(0)
    sys.exit()
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [0] + A
town = 1
visited = [0]*(N+1)

for i in range(1, K+1):
    town = A[town]
    if visited[town] == 0:
        visited[town] = i
    else:
        loop = i - visited[town]
        town = (K - visited[town]) % loop + visited[town]
print(town)

Fixed submission:
import sys

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [0] + A
town = 1
visited = [0]*(N+1)

for i in range(1, K+1):
    town = A[town]
    if visited[town] == 0:
        visited[town] = i
    else:
        loop = i - visited[town]
        place = (K - visited[town]) % loop + visited[town]
        print(visited.index(place))
        sys.exit()
print(town)

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

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
past_city = [1]
n = 0

for i in range(K):
    if len(past_city) == len(A) or i == K:
        print(past_city[-1])
        sys.exit()
    if A[past_city[i] - 1] in past_city:
        n = i + 1
        break
    past_city.append(A[past_city[i] - 1])
rem = K % n
print(past_city[rem])

Fixed submission:
import sys

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [0] + A
town = 1
visited = [0]*(N+1)

for i in range(1, K+1):
    town = A[town]
    if visited[town] == 0:
        visited[town] = i
    else:
        loop = i - visited[town]
        place = (K - visited[town]) % loop + visited[town]
        print(visited.index(place))
        sys.exit()
print(town)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
def divisor(num):
    L = []
    K = 0
    v = 0
    for i in range(num):
        if num%(i+1) == 0:
            L.append(i+1)
            K += 1
        else:
            continue
    if K%2 == 0:
        v = L[int(K/2)] + L[int(K/2-1)]
    elif K%2 == 1:
        v = 2*L[K/2]
    return v
print(divisor(N)-2)

Fixed submission:
import math
N = int(input())
for i in range(int(math.sqrt(N)), 0 , -1):
    if N%i == 0:
        ans = i+(N//i)-2
        print(ans)
        break
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
L = list(map(int, input().split()))
X = []
for i in range(len(L)):
    X.append(L.index(i+1)+1)
print(*X)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
b = [0]*N
# enumerate関数は指定のリストにインデックス番号を振ることが可能
for i, num in enumerate(L):
    b[num-1] = i+1
# *はリストの個々の要素を取り出すことが可能
print(*b)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, K, Q = map(int, input().split())
A = [input() for i in range(Q)]
me =np.full(N, K) 
for i in range(Q):
    me -= 1
    me[int(A[i])-1] += 1
for i in range(N):
    if me[i]>0:
        print("Yes")
    else:
        print("No")

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
a = np.zeros(N)
for i in range(Q):
    A = int(input())
    a[A-1] += 1
for i in range(N):
    if a[i] > Q-K:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())
pair={}

for _ in range(M):
    a, b = map(int, input().split())
    if a not in pair:
        pair[a-1]=[b-1]
    else:
        pair[a-1].append(b-1)
    if b not in pair:
        pair[b-1]=[a-1]
    else:
        pair[b-1].append(a-1)
# print(pair)

did=[]
ans=-1
queue=deque()
for i in range(N):
    if i not in did:
        queue.append(i)
    else:
        continue
    while(queue):
        now=queue.pop()
        did.append(now)
        # print(now)
        if now in pair:
            for j in pair[now]:
                if j not in queue and j not in did:
                    queue.append(j)
    ans+=1
print(ans)











Fixed submission:
import networkx as nx
N, M = map(int, input().split())

G=nx.Graph()

for _ in range(M):
    a, b = map(int, input().split())
    G.add_edge(a,b)

tmp= list(nx.connected_components(G))

count=0

for i in tmp:
    count+=len(i)


print(N-count+len(tmp)-1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
ans=1
for x in range(3,N+1):
    tmp=x-1
	ans+=tmp//x
 
print(ans)

Fixed submission:
N=int(input())
ans=0
for x in range(1,N):
  ans+=(N-1)//x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=1
for x in range(3,N+1):
    tmp=x-1
    for i in range(1,int(tmp**0.5)+1):
        if tmp%i==0:
            ans+=2
            if tmp//i ==i:
                ans-=1

print(ans)

Fixed submission:
N=int(input())
ans=0
for x in range(1,N):
  ans+=(N-1)//x
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=1
for x in range(3,N+1):
    tmp=x-1
    for i in range(1,int(tmp**0.5)+1):
        if tmp%i==0:
            ans+=2
            if tmp//i ==i:
                ans-=1

print(ans)

Fixed submission:
N=int(input())
ans=0
for x in range(1,N):
  ans+=(N-1)//x
print(ans)