Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
A = []
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if dic[x] == dic[y]:
        A.append(x)
        A.append(y)
    if dic[x] > dic[y]:
        A.append(y)
    else:
        A.append(x)
    
B = set(A)
for i in B:
    ten.remove(i)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
A = []
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if x in ten and y in ten:
        if dic[x] == dic[y]:
            A.append(x)
            A.append(y)
    if y in ten:
        if dic[x] > dic[y]:
            A.append(y)
    if x in ten:
        if dic[y] > dic[x]:
            A.append(x)
    
B = set(A)
for i in B:
    ten.remove(i)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
A = []
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if x in ten and y in ten:
        if dic[x] == dic[y]:
            A.append(x)
            A.append(y)
        elif dic[x] > dic[y]:
            A.append(y)
        else:
            A.append(x)
    
B = set(A)
for i in B:
    ten.remove(i)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
A = []
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if dic[x] == dic[y]:
        A.append(x)
        A.append(y)
    elif dic[x] > dic[y]:
        A.append(y)
    else:
        A.append(x)
    
B = set(A)
for i in B:
    ten.remove(i)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
A = []
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if dic[x] >= dic[y]:
        A.append(y)
    if dic[y] >= dic[x]:
        A.append(x)
B = set(A)
for i in B:
    ten.remove(i)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = (int(i) for i in input().split(' '))
ten = [i+1 for i in range(N)]
H = [int(i) for i in input().split(' ')]
dic = {}
for i in range(len(H)):
    list_item = H[i]
    dic[i+1] = list_item
for i in range(M):
    x, y = (int(a) for a in input().split(' '))
    if dic[x] >= dic[y]:
        if y in ten:
            ten.remove(y)
    if dic[y] >= dic[x]:
        if x in ten:
            ten.remove(x)
print(len(ten))

Fixed submission:
n,m=map(int,input().split())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=0
for v in range(1,n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
print(ans)