Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
H=list(map(int,input().split())
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
H=list(map(int,input().split))
check=[0]*N
for i in range(M):
  A,B=map(int,input.split)
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
H=list(map(int,input().split))
check=[0]*N
for i in range(M):
  A,B=map(int,input.split)
  if H[A-1]>H[B-1]:
    check[A-1]=check[A-1]+1
    check[B-1]=check[B-1]-1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]-1
    check[B-1]=check[B-1]+1
    
    
ans=check.count()

print(ans)

Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
total_tenb,total_load=map(int,input().split())

import copy
a=list(map(int,input().split()))
hight=copy.copy(a)
good_tenb=copy.copy(a)

  
def kuraberu(A,B):
  if hight[A-1]>hight[B-1]:
    good_tenb.append(height[A-1])
    good_tenb.pop(height[B-1])
  elif hight[A-1]<hight[B-1]:
    good_tenb.append(hight[B-1])
    good_tenb.pop(hight[A-1])
    
  
for h in range(total_load):
  A,B=map(int,input().split())
  kuraberu(A,B)
  
  
print(len(set(good_tenb)))


Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
total_tenb,total_load=map(int,input().split())
hight=[]
good_tenb=[]
for i in range(total_tenb):
  a=int(input())
  hight.append(a)
  good_tenb.append(a)
  
def kuraberu(A,B):
  if hight[A]>hight[B]:
    good_tenb.append(height[A])
    good_tenb.pop(height[B])
  elif hight[A]<hight[B]:
    good_tenb.append(hight[B])
    good_tenb.pop(hight[A])
    
  
for h in range(total_load):
  A[h]=int(input())
  B[h]=int(input())
  kuraberu(A[h],B[h])
  
  
print(len(set(good_tenb)))

Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
total_tenb,total_load=map(int,input().split())
hight=[]
good_tenb=[]
for i in range(total_tenb):
  a=int(input())
  hight.append(a)
  good_tenb.append(a)
  
def kuraberu(A,B):
  if hight[A]>hight[B]:
    good_tenb.append(height[A])
    good_tenb.del(height[B])
  elif hight[A]<hight[B]:
    good_tenb.append(hight[B])
    good_tenb.del(hight[A])
    
  
for h in range(total_load):
  A[h]=int(input())
  B[h]=int(input())
  kuraberu(A[h],B[h])
  
  
print(len(set(good_tenb)))  
  
  
  

Fixed submission:
N,M=map(int,input().split())
H=list(map(int,input().split()))
check=[0]*N
for i in range(M):
  A,B=map(int,input().split())
  if H[A-1]>H[B-1]:
    check[B-1]=check[B-1]+1
  elif H[A-1]<H[B-1]:
    check[A-1]=check[A-1]+1
  else:
      check[A-1]+=1
      check[B-1]+=1
    
    
ans=check.count(0)

print(ans)