Problem: There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.  Obs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road. Note that Obs. i is also good when no observatory can be reached from Obs. i using just one road.  How many good observatories are there?

Submission attempts (in order):
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)))  
  
  
  

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)

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)

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


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)

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

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)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted