peterverebics/CodeNet_Python_118 huggingface dataset:
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
N,M=MI()
Ten=[1 for _ in range(N)]
Michi=[[] for _ in range(N)]
H=LI()
for i in range(M):
  a,b=MI()
  a-=1
  b-=1
  Michi[a].append(b)
  Michi[b].append(a)  
for i in range(N):
  for j in Michi[i]:
    if H[i]<=H[j]:
      Ten[i]=0
      break
ans=sum(Ten)
print(ans)
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

N,M=MI()
H=LI()
ans=0
Michi=[[] for i in range(N)]
Ten=[1] *N
for i in range(M):
  a,b=MI()
  a-=1
  b-=1
  Michi[a].append(b)
  Michi[b].append(a)
for j in range(N):  
  for k in Michi[j]:
    if H[k]>=H[j]:
      Ten[j]=0
      break
ans=sum(Ten)
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] = -1
    elif H[B-1] > H[A-1]:
        check[A-1] = -1
    else:
        check[A-1],check[B-1] = -1,-1
print(check.count(0))
N, M = map(int, input().split())
H = [int(h) for h in input().split()]
Max = [h-1 for h in H]

for _ in range(M):
    ab = [int(_ab)-1 for _ab in input().split()]
    Max[ab[0]] = max(Max[ab[0]], H[ab[1]])
    Max[ab[1]] = max(H[ab[0]], Max[ab[1]])

cnt = 0
for n in range(N):
    if H[n] > Max[n]:
        cnt += 1
print(cnt)
N, M = map(int, input().split())
H = list(map(int, input().split()))
neib = {}

for n in range(N):
    neib[n]=[]

#print(neib)
#print()
for m in range(M):
    A, B = map(int, input().split())
    neib[A-1].append(H[B-1])
    neib[B-1].append(H[A-1])
    
count = 0
#print(neib)
#print()

for k, v in neib.items():
    if len(v)==0:
        count += 1
    elif H[k] > max(v):
        count += 1
print(count)
n,m = map(int,input().split())
h =  list(map(int,input().split()))
adj = [[] for _ in range(n)]
for i in range(m):
    s1,s2 = map(int,input().split())
    adj[s1-1].append(s2-1)
    adj[s2-1].append(s1-1)
total = 0
for i in range(n):
    if (len(adj[i]) == 0):
        total += 1
    else:
        total += int(all(h[i]>h[j] for j in adj[i]))
print(total)
n,m = map(int,input().split())
h = list(map(int,input().split()))

tembo = [True]*n

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

print(tembo.count(True))
import numpy as np
N, M = map(int, input().split())

H = np.array(list(map(int, input().split())))
# print(H)

good = np.ones(N)
for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    if H[A] == H[B]:
        good[A] = 0
        good[B] = 0
    elif H[A] > H[B]:
        good[B] = 0
    else:
        good[A] = 0
        
    # print(A, B)
    # print(good)
print(int(sum(good)))
# print(good)
N, M = map(int, input().split())
c_list = [[] for _ in range(N)]
e_list = list(map(int, input().split()))
for _ in range(M):
   a, b = map(lambda i: int(i) - 1, input().split())
   c_list[a].append(b)
   c_list[b].append(a)
ans = 0
for i, e in enumerate(e_list):
   for j in c_list[i]:
       if e <= e_list[j]:
           break
   else:
       ans += 1

print(ans)
n,m = map(int, input().split())
hl = list(map(int, input().split()))

e = [[] for _ in range(n)]
for _ in range(m):
    u,v = map(int, input().split())
    u -= 1
    v -= 1
    e[u].append(v)
    e[v].append(u)

res = 0
for u in range(n):
    flag = True
    h = hl[u]
    for v in e[u]:
        if hl[v]>=h:
            flag = False
            break
    # print(u,flag)
    if flag:
        res += 1
print(res)
n, m = map(int, input().split())
h = list(map(int, input().split()))
k = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    k[a-1].append(h[b-1])
    k[b-1].append(h[a-1])
a = 0
for i in range(n):
    if k[i] == [] or h[i] > max(k[i]):
        a += 1
print(a)
N,M = map(int,input().split())
H = list(map(int,input().split()))
H.insert(0,0)
G = {i:[] for i in range(1,N+1)}
for _ in range(M):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
cnt = 0
for i in range(1,N+1):
    flag = 1
    for x in G[i]:
        if H[x]>=H[i]:
            flag = 0
            break
    if flag==1:
        cnt += 1
print(cnt)
N, M = map(int, input().split())
H = list(map(int, input().split()))
adj = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    adj[a-1].append(H[b-1])
    adj[b-1].append(H[a-1])
cnt = 0
for idx in range(N):
    if len(adj[idx]) == 0:
        cnt += 1
    elif max(adj[idx]) < H[idx]:
        cnt += 1

print(cnt)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
t = {}
for n in range(1, N+1):
    t[n] = H[n-1]

r = set()
for m in range(M):
    A, B = list(map(int, input().split()))
    if t[A] < t[B]:
        r.add(A)
    elif t[B] < t[A]:
        r.add(B)
    else:
        r.add(A)
        r.add(B)
print(len(set(t.keys()) - r))
n,m = map(int,input().split())
h = list(map(int,input().split()))

data = [0]*n
#print(h)
#print(data)
for i in range(m):
    a,b = map(int,input().split())
    k = max(data[a-1],h[b-1])
    l = max(h[a-1],data[b-1])
    data[a-1],data[b-1] =k,l

ans = 0

#print(data)
for i in range(n):
    if h[i] > data[i]:
        ans += 1

print(ans)
n,m = map(int, input().split())
h = list(map(int, input().split()))

ab = [0]*n
for _ in range(m):
  a,b = map(int, input().split())
  ab[a-1] = max(ab[a-1], h[b-1])
  ab[b-1] = max(ab[b-1], h[a-1])

ans = 0
for i in range(n):
  if h[i] > ab[i]:
    ans += 1
print(ans)
n,m=map(int,input().split())
h=[int(w) for w in input().split()]
x=[0]*(n)
for i in range(m):
    a,b=map(int,input().split())
    
    x[a-1]=max(h[b-1],x[a-1])
    x[b-1]=max(h[a-1],x[b-1])
        
ans=0
for i in range(n):
    if (h[i]>x[i]) or x[i]==0:
        ans+=1
print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
e=[1]*n
for _ in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:e[b-1]=0
  elif h[a-1]<h[b-1]:e[a-1]=0
  else:
    e[a-1]=0
    e[b-1]=0
print(sum(e))
N,M=map(int,input().split())
*H,=map(int,input().split())

dmax=[0 for _ in range(N+1)]

for j in range(M):
    a,b=map(int,input().split())
    dmax[a-1]=max(dmax[a-1],H[b-1])
    dmax[b-1]=max(dmax[b-1],H[a-1])    
          
goodv = [1 for i in range(N) if dmax[i]<H[i]]
print(len(goodv))
n,m = map(int, input().split())
h = list(map(int, input().split()))
r = [0]*n
no = 1
for i in range(m):
    a,b = map(int, input().split())

    if(h[a-1] > h[b-1]):
        r[b-1] = 1
    elif(h[a-1] < h[b-1]):
        r[a-1] = 1
    elif(h[a-1] == h[b-1]):
        r[a-1] = 1
        r[b-1] = 1

count = 0
for i in range(n):
    if(r[i] == 0):
        count += 1

print(count)
n,m = map(int,input().split())
h = list(map(int,input().split()))

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

print(sum(l))
n,m=map(int,input().split())
h=list(map(int,input().split()))
ans=[1]*n

for i in range(m):
    a,b=map(int,input().split())
    a,b,=a-1,b-1
    if h[a]==h[b]:
        ans[a],ans[b]=0,0
    elif h[a]>h[b]:
        ans[b]=0
    else:
        ans[a]=0
print(ans.count(1))
n,m=map(int,input().split())
h=list(map(int,input().split()))
l=[0 for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    if h[a]>h[b]:
        l[b]+=1
    elif h[a]<h[b]:
        l[a]+=1
    else:
        l[a]+=1
        l[b]+=1
print(l.count(0))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ansa, ansb = 0, 0
ls = [0]*n

for _ in range(m):
    a, b = map(int, input().split())
    ansa = h[a-1]
    ansb = h[b-1]

    if ansa > ansb:
        ls[b-1] += 1

    elif ansa == ansb:
        ls[a-1] += 1
        ls[b-1] += 1

    else:
        ls[a-1] += 1

print(ls.count(0))
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    cand = set(range(N))
    for _ in range(M):
        A, B = map(int, input().split())
        A -= 1
        B -= 1
        if H[A] <= H[B] and A in cand:
            cand.remove(A)
        if H[B] <= H[A] and B in cand:
            cand.remove(B)
    print(len(cand))


if __name__ == "__main__":
    main()
n, m = map(int, input().split())
h = list(map(int, input().split()))
l = [0 for _ in range(n)]
for _ in range(m):
  a, b = map(int, input().split())
  l[a-1] = max(l[a-1], h[b-1])
  l[b-1] = max(l[b-1], h[a-1])

ans = 0
for i in range(n):
  if(h[i] > l[i]):
    ans += 1
print(ans)
n, m = map(int, input().split())
l = list(map(int, input().split()))
arrs = [list(map(int, input().split())) for i in range(m)]

s = set()

for i in range(m):
    arr = arrs[i]
    if l[arr[0]-1] < l[arr[1]-1]:
        s.add(arr[0])
    elif l[arr[0]-1] == l[arr[1]-1]:
        s.add(arr[0])
        s.add(arr[1])
    else:
        s.add(arr[1])

ans = n - len(s)
print(ans)
from collections import defaultdict, deque


N, M = map(int, input().split())
heights = [None] + [int(x) for x in 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)


# 連結する枝をすべて調べて良い展望台があれば True
def is_good(tower):
  return heights[tower] > max([heights[t] for t in G[tower]], default=0)


print(sum([is_good(t) for t in range(1, N + 1)]))
import collections
N, M= map(int, input().split())
H = list(map(int,input().split()))
C = [list(map(int, input().split())) for i in range(M)]
# print(C)
# Hs = {}

# for i in range(N):
#    Hs[i+1]=H[i]
# print(Hs)

# H_sorted = sorted(Hs.items(), key=lambda x: x[1], reverse=True)
# print(H_sorted)

# Np = 0
p = [1 for i in range(N)]
for c in C:
   if H[c[0]-1] <= H[c[1]-1]:
      p[c[0]-1]=0
   if H[c[0]-1] >= H[c[1]-1]:
      p[c[1]-1] = 0

print(sum(p))
N,M = map(int,input().split())
Height = list(map(int,input().split()))
ans = N
Data = [0]*(N+1)
for i in range(M):
    a,b = map(int,input().split())
    ha = Height[a-1]
    hb = Height[b-1]
    if ha <= hb:
        if Data[a] == 0:
            ans -= 1
            Data[a] = 1
    if ha >= hb:
        if Data[b] == 0:
            ans -= 1
            Data[b] = 1
print(ans)
n,m = map(int,input().split())
h = [None] + list(map(int,input().split()))
road = [[] for _ in range(n+1)]
count = 0
for _ in range(m):
    a,b = map(int,input().split())
    road[a].append(b)
    road[b].append(a)
for i in range(1,n+1):
    max_hight = 0
    for j in road[i]:
        max_hight = max(max_hight, h[j])
    if h[i]>max_hight:
        count += 1

print(count)
N,M = map(int,input().split())
H = [int(i) for i in input().split()]
AB = []
for m in range(M):
    AB.append([int(i) for i in input().split()])
from collections import defaultdict as ddict
R = ddict(list)
for ab in AB:
    R[ab[0]].append(ab[1])
    R[ab[1]].append(ab[0])
ans = 0
for n in range(1,N+1):
    highest = True
    for r in R[n]:
        if H[n-1] <= H[r-1]:
            highest = False
            break
    if highest:
        ans += 1
print(ans)
N,M=map(int,input().split())
H=list(map(int,input().split()))
O=[1]*N
for i in range(M):
    A,B=map(int,input().split())
    if H[A-1] > H[B-1] :
        O[B-1]=0
    elif H[A-1] < H[B-1]:
        O[A-1]=0
    elif H[A-1] == H[B-1]:
        O[A-1]=0
        O[B-1]=0
print(sum(O))
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
AB = [[int(x) - 1 for x in input().split()] for _ in range(M)]

peaks = {i: set() for i in range(N)}
for a, b in AB:
    peaks[a].add(b)
    peaks[b].add(a)

count = len(
    [
        i + 1 
        for i in peaks.keys() 
        if len(peaks[i]) == 0 or H[i] > max(
            [ H[v] for v in peaks[i] ]
        )
    ]
)

print(count)
import numpy as np

N,M=map(int,input().split())
H=list(map(int,input().split()))
pathes={}
for n in range(N):
  pathes[n+1]=[]
for i in range(M):
  A,B=map(int,input().split())
  pathes[A].append(B)
  pathes[B].append(A)
isGood=np.ones(N)

for k in range(N):
  path=pathes[k+1]
  for p in path :
    if H[k] <= H[p-1]:
      isGood[k]=-1
print(np.count_nonzero(isGood ==1))
N, M = map(int, input().split())
H = list(map(int, input().split()))

road = [set() for _ in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    road[A-1].add(B-1)
    road[B-1].add(A-1)

ans = [True] * N
for i in range(N):
    tmp = H[i]
    lis = list(road[i])
    for j in range(len(lis)):
        if tmp <= H[lis[j]]:
            ans[i] = False
            break

print(ans.count(True))
n,m = map(int,input().split())
hlist = list(map(int,input().split()))
ten = []
append = ten.append
for i in range(n):
    append(1)
#print(ten)
for i in range(m):
    a,b = map(int,input().split())
    if hlist[a-1] > hlist[b-1]:
        ten[b-1] = 0
    elif hlist[b-1] > hlist[a-1]:
        ten[a-1] = 0
    elif hlist[b-1] == hlist[a-1]:
        ten[a-1] = 0
        ten[b-1] = 0


print(sum(ten))
N,M = map(int,input().split())

Hight = [int(x) for x in input().split()]
judge = []
count = 0

for i in range(N):
    judge.append(True)

for i in range(M):
    A,B = map(int,input().split())
    if Hight[A-1] < Hight[B-1]:
        judge[A-1] = False
    elif Hight[A-1] == Hight[B-1]:
        judge[A-1] = False
        judge[B-1] = False
    else:
        judge[B-1] = False

for b in judge:
    if b:
        count += 1

print(count)
n,m=map(int,input().split())
h=list(map(int,input().split()))
tennbou=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    tennbou[b-1]=0
  elif h[a-1]<h[b-1]:
    tennbou[a-1]=0
  elif h[a-1]==h[b-1]:
    tennbou[a-1]=0
    tennbou[b-1]=0
  
print(tennbou.count(1))
n, m = map(int, input().split())
h = list(map(int, input().split()))
good = [1 for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] < h[b-1]:
        good[a-1] = 0
    elif h[a-1] > h[b-1]:
        good[b-1] = 0
    elif h[a-1] == h[b-1]:
        good[a-1] = good[b-1] = 0
print(sum(good))
import itertools
import numpy as np
N,M = map(int,input().split())
H = list(map(int,input().split()))
n=[1]*N
for i in range(0,M):
    m = list(map(int,input().split()))
    if H[m[0]-1] > H[m[1]-1]:
        n[m[1]-1]=0
    elif H[m[0]-1] == H[m[1]-1]:
        n[m[0]-1]=0
        n[m[1]-1]=0
    else:
        n[m[0]-1]=0
print(n.count(1))
N, M = map( int, input().split() )

H = list( map( int, input().split() ) )

L = [-1] * N
for i in range( M ):
  a, b = map( int, input().split() )
  if H[ a - 1 ] > H[ b - 1 ]:
    L[ b - 1 ] = a
  elif H[ a - 1 ] < H[ b - 1 ]:
    L[ a - 1 ] = b
  else:
    L[ b - 1 ] = a
    L[ a - 1 ] = b
    

cnt = 0
for i in L:
  if i < 0:
    cnt += 1
print( cnt )
n,m=map(int,input().split())
h=list(map(int,input().split()))
P=[list(map(int,input().split())) for i in range(m)]
good=[1]*n
for i in range(m):
  if h[P[i][0]-1]>=h[P[i][1]-1]:
    good[P[i][1]-1]=0
  if h[P[i][1]-1]>=h[P[i][0]-1]:
    good[P[i][0]-1]=0
print(sum(good))
n, m = map(int, input().split())
h = list(map(int, input().split()))
li=[0]*n
for i in range(m):
  c=list(map(int, input().split()))
  if h[c[0]-1]==h[c[1]-1]:
    li[c[0]-1]=1
    li[c[1]-1]=1    
  if h[c[0]-1]<h[c[1]-1]:
    li[c[0]-1]=1
  if h[c[0]-1]>h[c[1]-1]:
    li[c[1]-1]=1
sss=li.count(0)
print(sss)
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if int(H[a])>=int(H[b]):
        good[b] = 0
    if int(H[a])<=int(H[b]):
        good[a] = 0
print(sum(good))
import numpy as np
n, m = (int(x) for x in input().split())
h = [int(x) for x in input().split()]
b = np.zeros(n)
for i in range(m):
    s, k = (int(x) for x in input().split())
    if h[s-1] < h[k-1]:
        b[s-1] = 1
    elif h[k-1] < h[s-1]:
        b[k-1] = 1
    else:
        b[s-1] = 1
        b[k-1] = 1

print(np.count_nonzero(b==0))
n, m = map(int, input().split())
h = list(map(int, input().split()))
f = [1]*n
li = []
for i in range(int(m)):
    li.append(list(map(int, input().split())))
    if h[int(li[i][0])-1] > h[int(li[i][1])-1]:
        f[li[i][1]-1] = 0
    elif h[li[i][0]-1] < h[li[i][1]-1]:
        f[li[i][0]-1] = 0
    else:
        f[li[i][1]-1] = 0
        f[li[i][0]-1] = 0

print(f.count(1))
N, M=map(int,input().split())
H=list(map(int,input().split()))
ans=[1]*N
for i in range(M):
  A, B=map(int,input().split())
  x=H[A-1]
  y=H[B-1]
  if x>y:
    ans[B-1]=0
  elif x==y:
    ans[B-1]=0
    ans[A-1]=0
  elif y>x:
    ans[A-1]=0   
print(sum(ans))
n,m = map(int,input().split())
h = list(map(int,input().split()))
#h.sort()
l = [[] for _ in range(n)]

for i in range(m):
  a,b = map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)

c = 0
for j in range(n):
  if len(l[j]) == 0:
    c += 1
  else:
    m = 0
    for k in l[j]:
      if h[j] <= h[k]:
        m = 1
        break
    if m == 0:

      c += 1
      
print(c)
N, M = list(map(int, input().split()))
H = [0,] + list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(M)]
B = [1] * N
for i in range(M):
    if H[A[i][0]] < H[A[i][1]]:
        B[A[i][0] - 1] = 0
    elif H[A[i][0]] > H[A[i][1]]:
        B[A[i][1] - 1] = 0
    else:
        B[A[i][0] - 1] = 0
        B[A[i][1] - 1] = 0
print(sum(B))
n,m = map(int, input().split())
h_list = list(map(int, input().split())) #元リスト（変えない）
newlist = list(h_list) #変換用リスト
for i in range(m):
    a, b = map(int, input().split())
    if h_list[a-1] < h_list[b-1]:
        newlist[a-1] = 0
    elif h_list[a-1] > h_list[b-1]:
        newlist[b-1] = 0
    else:
        newlist[a-1] = 0
        newlist[b-1] = 0
print(n - newlist.count(0))
n, m = map(int, input().split())
h = [None] + [int(x) for x in input().split()]

res = [0] + ([1] * n)

for _ in range(m):
    a, b = map(int, input().split())
    if h[a] >= h[b]:
        res[b] = 0
    if h[a] <= h[b]:
        res[a] = 0

print(sum(res))
import sys
input=lambda: sys.stdin.readline().rstrip()
n,m=map(int,input().split())
H=[int(i) for i in input().split()]
edge = [[] for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
ans=0
for i in range(n):
  h=H[i]
  chk=True
  for g in edge[i]:
    if H[g]>=h:
      chk=False
  if chk:
    ans+=1
print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
high=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    high[b-1]=0
  elif h[a-1]<h[b-1]:
    high[a-1]=0
  else:
    high[a-1]=0
    high[b-1]=0
print(sum(high))
import collections
n,m = list(map(int,input().split()))
tower_high = list(map(int,input().split()))
good_tower = [1]*n

def check_tower(a,b):
    if tower_high[a]<tower_high[b]:
        good_tower[a]=0
    elif tower_high[a] > tower_high[b]:
        good_tower[b]=0
    else:
        good_tower[a]=0
        good_tower[b]=0

for i in range(m):
    a,b=list(map(int,input().split()))
    check_tower(a-1,b-1)
print(good_tower.count(1))
N, M = (int(x) for x in input().split())
H = list(map(int, input().split()))

HT = [0 for i in range(N)]

for i in range(M):
    A, B = (int(x) for x in input().split())
    HT[A-1] = max(HT[A-1], H[B-1])
    HT[B-1] = max(HT[B-1], H[A-1])
    
count = 0

for i in range(N):
    count += H[i] > HT[i]

print(count)
n,m = map(int,input().split())
h = list(map(int,input().split()))
route = []
lower = []
cnt = 0
for i in range (m):
    s = list(map(int,input().split()))
    if h[s[0]-1] > h[s[1]-1]:
        lower.append(s[1])
    elif h[s[1]-1] > h[s[0]-1]:
        lower.append(s[0])
    elif h[s[1]-1] == h[s[0]-1]:
        lower.append(s[0])
        lower.append(s[1])
low = list(set(lower))
cnt =n-len(low)
print(cnt)
n,m = map(int,input().split())
h = list(map(int,input().split()))
H = [0] * n
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    H[a] = max(H[a], h[b])
    H[b] = max(H[b], h[a])
ans = 0
for i in range(n):
    if H[i] < h[i]:
        ans += 1
print(ans)
N, M = map(int, input().split(' '))
H_ls = list(map(int, input().split(' ')))
edge, rst = [ [] for i in range(N) ], 0
for i in range(M):
    a, b = map(int, input().split(' '))
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)
for i in range(N):
    is_peak = True
    for j in edge[i]:
        if H_ls[i] <= H_ls[j]:
            is_peak = False
            break
    if is_peak:
        rst += 1
print(rst)
n, m = map(int, input().split())
h = list(map(int, input().split()))
flag = [1] * n
for i in range(m):
    p1, p2 = map(int, input().split())
    if h[p1-1] == h[p2-1]:
        flag[p1-1], flag[p2-1] = 0, 0
    elif h[p1-1] < h[p2-1]:
        flag[p1-1] = 0
    else:
        flag[p2-1] = 0
print(flag.count(1))
n,m = map(int, input().split())
h = list(map(int, input().split()))
road_list = [list(map(int, input().split()))]
for _ in range(m-1):
    road_list.append(list(map(int,input().split())))

lower_set = set()
for road in road_list:
    if h[road[0]-1] >= h[road[1]-1]:
        lower_set.add(road[1]-1)
        
    if h[road[0]-1] <= h[road[1]-1]:
        lower_set.add(road[0]-1)

count = 0
for i in range(n):
    if not i in lower_set:
        count += 1

print(count)
def main():
    n, m = map(int, input().split())
    h = list(map(int, input().split()))
    to = [0]*n
    ans = 0
    for i in range(m):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        to[a] = max(to[a], h[b])
        to[b] = max(to[b], h[a])
    for i, hi in enumerate(h):
        if hi > to[i]:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()
n, m = map(int, input().split())
h = list(map(int, input().split())) 
ab = [list(map(int, input().split())) for i in range(m)]

g = [[] for i in range(n)]
for i in range(m):
    a,b = ab[i]
    g[a-1].append(h[b-1])
    g[b-1].append(h[a-1])

cnt = 0
for i in range(n):
    if g[i] == []:
        mx = 0
    else:
        mx = max(g[i])
    if h[i] > mx:
        cnt += 1 

print(cnt)
n, m = map(int, input().split())
l = [*map(int, input().split())]
adj = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    adj[a - 1].append(b - 1)
    adj[b - 1].append(a - 1)
cnt = 0
for i in range(n):
    cnt += all(l[i] > l[j] for j in adj[i])
print(cnt)
N, M = [int(_) for _ in input().split()]
H = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for i in range(M)]

from collections import defaultdict

ds = defaultdict(set)

for a, b in AB:
    ds[a - 1].add(b - 1)
    ds[b - 1].add(a - 1)

result = 0

for i in range(N):
    # print(i, H[i], ds[i])
    if not ds[i] or all(H[d] < H[i] for d in ds[i]):
        result += 1

print(result)
N, M = map(int, input().split())
H = list(map(int, input().split()))

AL = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    A = A-1
    B = B-1

    AL[A].append(B)
    AL[B].append(A)

ans = 0

for i in range(N):
    h = H[i]
    ahl = [H[j] for j in AL[i]]
    if ahl:
        if h > max(ahl):
            ans+=1
    else: ans+=1
    
print(ans)
N, M, *I = map(int, open(0).read().split())
H, AB = [0] + I[:N], I[N:]

memo = [False] + [True] * N
for a, b in zip(*[iter(AB)] * 2):
    if H[a] < H[b]:
        memo[a] = False
    elif H[b] < H[a]:
        memo[b] = False
    else:
        memo[a] = memo[b] = False

print(sum(memo))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ok = [True] * 100001

for _ in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        ok[b-1] = False
    elif h[b-1] > h[a-1]:
        ok[a-1] = False
    else:
        ok[a-1] = False
        ok[b-1] = False

count = 0

for i in range(n):
    if ok[i]:
        count += 1

print(count)
N, M = (int(x) for x in input().split())
H = list(map(int, input().split()))

result = [1] * N

for i in range(M):
  a, b = map(int, input().split())
  if H[a-1] < H[b-1]:
    result[a-1] = 0
  elif H[a-1] == H[b-1]:
    result[a-1] = 0
    result[b-1] = 0
  elif H[a-1] > H[b-1]:
    result[b-1] = 0
print(sum(result))