Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q=map(int, input().split())
A=np.array([int(input()) for _ in range(Q)])
P=np.array([K]*N)
for a in A:
    p=np.array([1]*N)
    p[a-1]=0
    P-=p
for x in P:
    if x>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N,K,Q=map(int, input().split())
A=[int(input()) for _ in range(Q)]
P=[0]*N
for a in A:
    P[a-1]+=1
for x in P:
    if K-Q+x>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,M=map(int, input().split())
A=np.array(list(map(int, input().split())))
for i in range(M):
    x=np.argmax(A)
    A[x]=A[x]//2
print(sum(A))

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
A.sort()
B=[A.pop()//2]
M-=1

while(M):
    if A[-1]>B[-1]:
        B.insert(0,A.pop()//2)
    else:
        b=B.pop()//2
        B.insert(0,b)
    M-=1
    
print(sum(A)+sum(B))

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,M=map(int, input().split())
A=np.array(list(map(int, input().split())))
A=np.sort(A)[::-1]
B=A[:M]
for i in range(M):
    B[B.argmax()]=B[B.argmax()]//2
print(sum(A))

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
A.sort()
a=A.pop()
b=A.pop()
for i in range(M):
    if a>=b:
        a=a//2
    else:
        A.append(a)
        A.append(b//2)
        A.sort()
        a=A.pop()
        b=A.pop()
        
print(sum(A)+a+b)

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
for i in range(M):
    A[A.index(max(A))]=A[A.index(max(A))]//2
print(sum(A))

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,M=map(int, input().split())
A=np.array(list(map(int, input().split())))
for i in range(M):
    A[A.argmax()]=A[A.argmax()]//2
print(sum(A))

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))
Buggy python submission (verdict: Runtime Error):
if K<N//2+1:
    for i in range(K):
        flag=0
        old=S[0]
        reverse=[]

        for j in range(1,N):
    #         print(j,old,S[j])
            if S[j]!=old:
                reverse.append(j)
                old=S[j]

            if len(reverse)==2:

                for k in range(reverse[0],reverse[1]):

                    if S[k]=='R':
                        S[k]='L'
                    else:
                        S[k]='R'
                break

        if len(reverse)==1:
                 for k in range(reverse[0],N):
                    if S[k]=='R':
                        S[k]='L'
                    else:
                        S[k]='R'
    old='aaa'
    ans=0
    for s in S:
        if old==s:
            ans+=1
        old=s
    print(ans)
else:
    print(N)

Fixed submission:
N,K=map(int,input().split())
S=list(input())

old='X'
count=0
for i,s in enumerate(S):
    if s==old:
        count+=1

    old=s
print(min(count+2*K,N-1))
Buggy python submission (verdict: Runtime Error):
M, D   = map(int, input().split())ans=0
for i in range(M):
    m=i+1
    for j in range(D):
        d=j+1
        d1=d%10
        d10=d//10
        if d1>=2 and d10>=2 and m==d10*d1:
            ans+=1
#             print(m,d)
print(ans)

Fixed submission:
M, D   = map(int, input().split())
ans=0
for i in range(M):
    m=i+1
    for j in range(D):
        d=j+1
        d1=d%10
        d10=d//10
        if d1>=2 and d10>=2 and m==d10*d1:
            ans+=1
#             print(m,d)
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B   = map(int, input().spli
x= A+B
y= A-B
z=A*B
print(max([x,y,z]))

Fixed submission:
A, B   = map(int, input().split())
x= A+B
y= A-B
z=A*B
print(max([x,y,z]))
Buggy python submission (verdict: Runtime Error):
S=int(input())
x=int(math.sqrt(S))
y=S-x**2
print(2,0,x+2,y,1,x)

Fixed submission:
S=int(input())
a=10**9
b=0
c=S%a
d=S//a+1
if S==1000000000000000000:
    print(0,0,10**9,0,0,10**9)
else:
    print(0,1,a,b,c,d)

Buggy python submission (verdict: Runtime Error):
S = int(input())
y=1
for i in range(2,S+1):
    if S%i==0:
        y*=i
        x=int(S/y)
        if x < 10**9:
            break
print(0,0, x, 0, 0, y)

Fixed submission:
S=int(input())
a=10**9
b=0
c=S%a
d=S//a+1
if S==1000000000000000000:
    print(0,0,10**9,0,0,10**9)
else:
    print(0,1,a,b,c,d)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
half=int(N/2)
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[]
for i in range(N):
    if B[i]==1:
        C.append(i+1)
m=sum(B)
print(m)
print(*C)

Fixed submission:
r = int(input())
print(3*r**2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[]
for i in range(N):
    if B[i]==1:
        C.append(i+1)
m=sum(B)
print(m)
print(*C)

Fixed submission:
r = int(input())
print(3*r**2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[]
for i in range(N):
    if B[i]==1:
        C.append(i+1)
m=sum(B)
print(m)
for i in range(m):
    print(C[i])

Fixed submission:
r = int(input())
print(3*r**2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A=list(map(int, input().split()))
all=int(sum(A)/2)
ans=[]
for i in range(N):
    index=[]
    for j in range(int(N/2)):
        k=(i+1+2*j)%N
        index.append(A[k])
    x=sum(index)
    ans.append((all-x)*2)
for a in ans:
  print(a)

Fixed submission:
N = int(input())
A=list(map(int, input().split()))
all=int(sum(A)/2)
ans=[]
index=[]
i=0
for j in range(int(N/2)):
    k=(i+1+2*j)%N
    index.append(A[k])    
x=all-sum(index)
ans.append((x)*2)
for i in range(N-1):
    y=A[i]-x
    ans.append((y)*2)
    x=y
for a in ans:
    print(a)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
ans=B-A+1

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E=lcm(C,D)

if A%C==0:
    nC_initial=A//C
else:
    nC_initial=A//C+1
    
if A%D==0:
    nD_initial=A//D
else:
    nD_initial=A//D+1

    
if A%E==0:
    nE_initial=A//E
else:
    nE_initial=A//E+1
    
nC_final=B//C
nD_final=B//D
nE_final=B//E
if nC_final<nC_initial:
    nC_final=nC_initial
if nD_final<nD_initial:
    nD_final=nD_initial
if nE_final<nE_initial:
    nE_final=nE_initial
#print(ans,nC_initial,nC_final,nD_initial,nD_final, nE_initial,nE_final)
print(ans-(nC_final-nC_initial+1)-(nD_final-nD_initial+1)+(nE_final-nE_initial+1))

Fixed submission:

import fractions

A,B,C,D = map(int, input().split())
ans=B-A+1


E=D * C // fractions.gcd(C, D)

if A%C==0:
    nC_initial=A//C
else:
    nC_initial=A//C+1
    
if A%D==0:
    nD_initial=A//D
else:
    nD_initial=A//D+1

    
if A%E==0:
    nE_initial=A//E
else:
    nE_initial=A//E+1
    
nC_final=B//C
nD_final=B//D
nE_final=B//E
if nC_final<nC_initial:
    nC_final=nC_initial
if nD_final<nD_initial:
    nD_final=nD_initial
if nE_final<nE_initial:
    nE_final=nE_initial
nc=(nC_final-nC_initial+1)
nd=(nD_final-nD_initial+1)
ne=(nE_final-nE_initial+1)
if B<C:
    nc=0
    ne=0
if B<D:
    nd=0
    ne=0
if B<E:
    ne=0


#print(ans,nC_initial,nC_final,nD_initial,nD_final, nE_initial,nE_final)
#print(ans,nc,nd,ne)
print(ans-nc-nd+ne)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D = map(int, input().split())
ans=0
for x in range(A,B+1):
    if x%C!=0 and x%D!=0:
        ans+=1
print(ans)

Fixed submission:

import fractions

A,B,C,D = map(int, input().split())
ans=B-A+1


E=D * C // fractions.gcd(C, D)

if A%C==0:
    nC_initial=A//C
else:
    nC_initial=A//C+1
    
if A%D==0:
    nD_initial=A//D
else:
    nD_initial=A//D+1

    
if A%E==0:
    nE_initial=A//E
else:
    nE_initial=A//E+1
    
nC_final=B//C
nD_final=B//D
nE_final=B//E
if nC_final<nC_initial:
    nC_final=nC_initial
if nD_final<nD_initial:
    nD_final=nD_initial
if nE_final<nE_initial:
    nE_final=nE_initial
nc=(nC_final-nC_initial+1)
nd=(nD_final-nD_initial+1)
ne=(nE_final-nE_initial+1)
if B<C:
    nc=0
    ne=0
if B<D:
    nd=0
    ne=0
if B<E:
    ne=0


#print(ans,nC_initial,nC_final,nD_initial,nD_final, nE_initial,nE_final)
#print(ans,nc,nd,ne)
print(ans-nc-nd+ne)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A>=13:
    print(B)
elif A<=5:
    print(0)
else:
    print(int(B/2)

Fixed submission:
A, B = map(int, input().split())
if A>=13:
    print(B)
elif A<=5:
    print(0)
else:
    print(int(B/2))
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())

points=[]
for i in range(N):
    x=K/(i+1)
    y=math.log(x)/math.log(2)
    y=max(0,math.ceil(y))
    z=pow(2,-math.ceil(y))
    points.append(z)
print(sum(points)/N)

Fixed submission:
import math
N,K=map(int,input().split())

points=[]
for i in range(N):
    x=K/(i+1)
    y=math.log(x)/math.log(2)
    y=max(0,math.ceil(y))
    z=pow(2,-math.ceil(y))
    points.append(z)
print(sum(points)/N)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
half=[K]
for i in range(1,K):
    if K%(2**i)==0:
        half.append(int(K/(2**i)))
    else:
        half.append(1+int(K/(2**i)))
    maxi=i
    if int(K/(2**i))==0:
        break
half.sort()

ans=[]
if half[0]<N:
   # ans.append(half[0]/(2**(maxi)))

    for i in range(maxi):

        
        if half[i+1]<N:
            sa=half[i+1]-half[i]
        #    print(half[i],sa)
            ans.append(sa/(2**(maxi-i)))
        else:
            sa=N-half[i]
      #      print(half[i],sa)
            ans.append(sa/(2**(maxi-i)))
            j=i
            break

if half[j+1]==N:
    #print(half[j+1])
    ans.append(1/(2**(maxi-j-1)))
            
if half[-1]<N:
    sa=N-half[-1]+1
  #  print(half[-1],sa,"kjh")
    ans.append(sa)



#print(half)
#print(ans)
ans=sum(ans)/N
print(ans)

Fixed submission:
import math
N,K=map(int,input().split())

points=[]
for i in range(N):
    x=K/(i+1)
    y=math.log(x)/math.log(2)
    y=max(0,math.ceil(y))
    z=pow(2,-math.ceil(y))
    points.append(z)
print(sum(points)/N)
Buggy python submission (verdict: Time Limit Exceeded):
R, G,B,N = map(int, input().split())
l=[R, G, B]

l.reverse()
r_max=N//l[0]
g_max=N//l[1]
RR=l[0]
GG=l[1]
BB=l[2]
ans=0
for r in range(r_max+1):
    res=N-r*RR
    for g in range(g_max+1):
        x=res-GG*g
        if x>=0 and x%BB==0:
            ans+=1
            
print(ans)

Fixed submission:
R, G,B,N = map(int, input().split())
l=[R, G, B]

l.reverse()
r_max=N//l[0]
g_max=N//l[1]
RR=l[0]
GG=l[1]
BB=l[2]
ans=0
for r in range(r_max+1):
    res=N-r*RR
    for g in range(g_max+1):
        x=res-GG*g
        if x<0:
            break
        if x%BB==0:
            ans+=1
            
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G,B,N = map(int, input().split())
r_max=N//R
g_max=N//G
b_max=N//B
ans=0
for r in range(r_max+1):
    res=N-r*R
    for g in range(g_max+1):
        x=(res-G*g)
        if x>=0 and x%B==0:
            ans+=1
print(ans)

Fixed submission:
R, G,B,N = map(int, input().split())
l=[R, G, B]

l.reverse()
r_max=N//l[0]
g_max=N//l[1]
RR=l[0]
GG=l[1]
BB=l[2]
ans=0
for r in range(r_max+1):
    res=N-r*RR
    for g in range(g_max+1):
        x=res-GG*g
        if x<0:
            break
        if x%BB==0:
            ans+=1
            
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))
C=list(set(A))

#print(A)
#print(C)
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

anslist=[]

if len(C)==1:
  ans=C[0]

elif len(C)==2:
  sol=max(A[0],A[1])

else:
  for i in range(3):
    B=A[:]
    B.remove(C[i])
    sol=0
    for b in B:
        sol=gcd(sol,b)
    anslist.append(sol)
    ans=max(anslist)

#print(anslist)
print(ans)



Fixed submission:
A, B, T = map(int, input().split())
print(int((T+1/2)/A)*B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))


def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

ans=[]

for i in range(3):
    B=A[:]
    del B[i]
    sol=0
    for b in B:
        sol=gcd(sol,b)
    ans.append(sol)


print(max(ans))



Fixed submission:
A, B, T = map(int, input().split())
print(int((T+1/2)/A)*B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S =(list(input()))
newS=[]
for i in S:
    if i == ".":
        newS.append(0)
    else:
        newS.append(1)

points10=[]
before=0
for i,s in enumerate(newS):
    if before -s ==1:
        points10.append(i)
    before = s

ans=[]
for i in points10:
    countW=0
    countB=0
    for j,s in enumerate(newS):
        if j<i:
            if s==1:
                countB=countB+1
        else:
            if s==0:
                countW=countW+1
    #print(countW,countB)
    ans.append(countB+countW-1)
#print(ans)
print(min(ans))

Fixed submission:
N = int(input())
S =(list(input()))
newS=[]
for i in S:
    if i == ".":
        newS.append(0)
    else:
        newS.append(1)

countW=newS.count(0)
countB=newS.count(1)
ans=min(countW,countB)
countB=0
for s in newS:
    if s ==1:
        
        countB+=1
    else:
      countW-=1
      
        
    ans=min(ans,countB+countW)
    #print(countB,countW)
#print(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
alphabet=[chr(i) for i in range(ord('a'),ord('z')+1)]
if len(S)!=26:
    for x in alphabet: 
        if not(x in set(S)):
            flag=1
            break
    ans=S+x
    print(ans)
else:
    s=ord(S[25])
    for i in range(24,-1,-1):
        if s<ord(S[i]):
            j=i
            s=ord(S[i])

    if j==0:
        print(-1)
    else:
        l=S[j:]
        y=300
        for x in list(map(ord,l)):
            if ord(S[j-1])<x:
                y=min(y,x)
        ans=S[:j-1]+chr(y)
        print(ans)

Fixed submission:
S=input()
alphabet=[chr(i) for i in range(ord('a'),ord('z')+1)]
if len(S)!=26:
    for x in alphabet: 
        if not(x in set(S)):
            flag=1
            break
    ans=S+x
    print(ans)
else:
    s=ord(S[25])
    j=25
    for i in range(24,-1,-1):
        if s<ord(S[i]):
            j=i
            s=ord(S[i])
        else:
            break

    if j==0:
        print(-1)
    else:
        l=S[j:]
        y=300
        for x in list(map(ord,l)):
            if ord(S[j-1])<x:
                y=min(y,x)
        ans=S[:j-1]+chr(y)
        print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0
count=0
for i in range(s-t+1):
  for j in range(t):
    if T[i]==S[j+i]:
      count += 1
  max_count=max(max_count,count)
  count=0  
print(t-max_count)

Fixed submission:
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0
count=0
for i in range(s-t+1):
  for j in range(t):
    if T[j]==S[i+j]:
      count += 1
  max_count=max(max_count,count)
  count=0  
print(t-max_count)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0

for i in range(s-t+1):
  count=0
  for j in range(t):
    if T[i]==S[j+i]:
      count += 1
  max_count=max(max_count,count)
    
print(t-max_count)

Fixed submission:
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0
count=0
for i in range(s-t+1):
  for j in range(t):
    if T[j]==S[i+j]:
      count += 1
  max_count=max(max_count,count)
  count=0  
print(t-max_count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n - 1):
    b = a[0]
    a.pop(0)
    ans += b * sum(a)

print(ans % (10 ** 9 + 7))        


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
c = sum(a)

for i in range(n - 1):
    c = c - a[i]
    ans += a[i] * c

print(ans % (10 ** 9 + 7))

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

for i in range(n - 1):
    for j in range(n - i - 1):
        ans += a[i] * a[j + i + 1]

print(ans % (10 ** 9 + 7))        


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
c = sum(a)

for i in range(n - 1):
    c = c - a[i]
    ans += a[i] * c

print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
count = 0

for i in range(n):
    x, y = map(int, input(), split())
    if d^2 >= x^2 + y^2:
        count += 1

print(count)


Fixed submission:
n, d = map(int, input().split())
count = 0

for i in range(n):
    x, y = map(int, input().split())
    if d * d >= x * x + y * y:
        count = count + 1

print(count)
Buggy python submission (verdict: Runtime Error):
import math
a, b, h, m = map(int, input().split())

n = 60 * h + m

r = n * math.pi * 11 / 360

ans = math.sqrt(a ** 2 + b ** 2 - 0.5 * a * b * math.cos(r))

print(ans)


Fixed submission:
n = int(input())

while n >= 10:
    n -= 10

if n == 3:
    print("bon")

elif n == 0 or n == 1 or n == 6 or n == 8:
    print("pon")

else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

b = 1

for i in range(k + 1):
    b = a[b - 1]

print(b)


Fixed submission:
s = input()
t = input()

n = len(t)

if t[0:n-1] == s:
  print("Yes")
  
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))

b = 1

for i in range(n + 1):
    b = a[b]

print(b)


Fixed submission:
s = input()
t = input()

n = len(t)

if t[0:n-1] == s:
  print("Yes")
  
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))

ans = 0
a = []
b = []

for i in range(m):
    a_i, b_i = map(int,input().split())
    a.append(a_i)
    b.append(b_i)

for i in range(n):
    h_i = [0]
    if i + 1 in a:
        h_i.append(h[b[a.index(i + 1)] - 1])
    if i + 1 in b:
        h_i.append(h[a[b.index(i + a)] - 1])
    if h[i] > max(h_i):
        ans += 1

print(ans)


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

ans = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        ans[a - 1] += 1
    elif h[a - 1] > h[b -1]:
        ans[b - 1] += 1
    else:
        ans[a - 1] += 1
        ans[b - 1] += 1

print(ans.count(0))

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

ans = 0
a = []
b = []

for i in range(m):
    a_i, b_i = map(int,input().split())
    a.append(a_i)
    b.append(b_i)

for i in range(n):
    h_i = [0]
    for j in range(m):
        if a[j] == i + 1:
            h_i.append(h[b[j] - 1])
        if b[j] == i + 1:
            h_i.append(h[a[j] - 1])
    if h[i] > max(h_i):
        ans += 1

print(ans)


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

ans = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        ans[a - 1] += 1
    elif h[a - 1] > h[b -1]:
        ans[b - 1] += 1
    else:
        ans[a - 1] += 1
        ans[b - 1] += 1

print(ans.count(0))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    ans = 0
    for j in range(n - 1):
        if i + 1 == a[j]:
            ans += 1
    print(ans)


Fixed submission:
r = int(input())
print(r * 3.14159 * 2)
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()))

ans = [0]* n

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

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()))

ans = [0]* n

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

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()))

ans = [0]* n

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

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

for i in range(n):
    ans = a.count(i + 1)
    print(ans)


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

ans = [0]* n

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

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

for i in range(n):
    ans = 0
    for j in range(n - 1):
        if i + 1 == a[j]:
            ans += 1
    print(ans)


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

ans = [0]* n

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

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

for i in range(n):
    ans = 0
    for j in range(n - 1):
        if i + 1 == a[j]:
            ans += 1
    print(ans)


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

ans = [0]* n

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