peterverebics/CodeNet_Python_118 huggingface dataset:
n, m = map(int, input().split())
h = list(map(int, input().split()))
t = [set() for _ in range(n)]

for _ in range(m):
    a,b = map(int, input().split())
    t[a-1].add(b-1)
    t[b-1].add(a-1)
ans = 0
for i in range(n):
    now_t = h[i]
    if t[i]:
        if all([now_t > tall for tall in t[i]]):
            ans += 1
print(ans)
N, M = map(int, input().split( ))
i = 1
ViewH = {}
H_list = input().split( )
countlist = []
while i <= N:
    ViewH[i] = int(H_list[i-1])
    countlist.append(0)
    i += 1


for count in range(M - 1):
    A, B = map(int, input().split())
    if ViewH[A] > ViewH[B]:
        countlist[B-1] = 1
    elif ViewH[A] == ViewH[B]:
        countlist[A-1] = 1
        countlist[B-1] = 1
    else:
        countlist[A-1] = 1

print(countlist.count(0))
n,m = map(int,input().split())
h = set(map(int,input().split()))
H = h
count = 0
for i in range(m):
    a,b = map(int,input().split())
    if a < b:
        h.discard(a)
    elif a > b:
        h.discard(b)

print(len(h))
n,m=map(int,input().split())
h=list(map(int,input().split()))
ab=[]
for _ in range(m):
    ab.append(list(map(int,input().split())))

good=[1]*n
for i in range(m):
    if h[ab[i][0]-1]<h[ab[i][1]-1]:
        good[ab[i][0]-1]=0
    else:
        good[ab[i][1]-1]=0
print(sum(good))
n, m = map(int, input().split())
h = list(map(int, input().split()))
list1 = [1] * n
for _ in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        list1[a - 1] = 0
    if h[a - 1] > h[b - 1]:
        list1[b - 1] = 0
print(sum(list1))
def solve(way, height, n):
  ss = set()
  for a,b in way:
    if height[a-1] == height[b-1]:
      ss = ss | {a,b}
    else:
      remove_idx = a if height[a-1] < height[b-1] else b
      ss = ss | {remove_idx}
  return n - len(ss)


if __name__ == "__main__":
  n,m = map(int, input().split())
  height = [int(i) for i in input().split()]
  way = [tuple(map(int, input().split())) for i in range(m)]
  print(way)
  print(solve(way, height, n))
n, m = map(int, input().split())
h = list(map(int, input().split()))
bridge = []
connected = [0 for _ in range(n)]
good = [0 for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if h[a] < h[b]:
        good[b] += 1
    elif h[b] < h[a]:
        good[a] += 1
    connected[a] = 1
    connected[b] = 1

noc = connected.count(0)
gc = n - good.count(0)

print(noc + gc)
n, m = map(int,input().split())

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

temp_h = h.copy()

for _ in range(m):
    x1, x2 = map(int,input().split())

    temp_h[x1 - 1] = max([temp_h[x1 - 1], temp_h[x2 - 1]])
    temp_h[x2 - 1] = max([temp_h[x1 - 1], temp_h[x2 - 1]])

res = [1 if x - y else 0 for x, y in zip(h, temp_h)]

print(sum(res))
n,m = map(int, input().split())
h = [int(_) for _ in input().split()]
l=['']*n
for x in range(m):
    a,b = map(int, input().split())
    if h[a - 1] >= h[b - 1]:
        l[a - 1] = 'good'
    else:
        l[b - 1] = 'good'
print(l.count('good'))
import numpy as np
N, M = map(int,input().split())
C = np.zeros(N)
d = 0
H = list(map(int,input().split()))
for i in range(M):
  A, B = map(int,input().split())
  if H[A - 1] < H[B -1]:
    C[A - 1] += 1
  else:
    C[B - 1] += 1
for j in range(N):
  if C[j] == 0:
    d += 1
print(d)
nm=input().split()
h=input().split()
ans=set(range(int(nm[0])))
for i in range(int(nm[1])):
    ab=input().split()
    a=int(ab[0])-1
    b=int(ab[1])-1
    if(h[a]>=h[b]):
        ans.discard(b)
    if(h[b]>=h[a]):
        ans.discard(a)
print(len(ans))
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = [0]* n
result =0

for j in range(m):
    text = list(map(int,input().split()))

    if h[text[0]-1] < h[text[1]-1]:
        ans[text[0]-1] += 1
    else:
        ans[text[1]-1] += 1

for i in ans:
    if i == 0:
        result +=1
print(result)
import sys
import math

n, m = map(int, input().split())
h = list(map(int, input().split()))
ma = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    ma[a - 1] = max(ma[a-1],h[b - 1])
    ma[b - 1] = max(ma[b-1] ,h[a - 1])
cnt = 0
print(ma)
print(h)
for i in range(n):
    if h[i] > ma[i]:
        cnt += 1
print(cnt)
n, m = map(int, input().split())
h = list(map(int, input().split()))
maxh = []
for height in h:
    maxh.append(height)
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    maxh[a] = max(maxh[a], h[b])
    maxh[b] = max(maxh[b], h[a])
g = 0
for height, maxheight in zip(h, maxh):
    if height == maxheight:
        g += 1
print(g)
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))

ans = np.array(list(range(N)))

for _ in range(M):
  A, B = map(int, input().split())
  if H[A-1] >= H[B-1]:
    ans[B-1] = -1
  elif H[A-1] <= H[B-1]:
    ans[A-1] = -1
print(len(ans[ans!=-1]))
n,m = map(int,input().split())
h = list(map(int,input().split()))
judge = [True] * n

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

print(judge.count(True))
import sys
input = sys.stdin.readline

# C - Peaks
import copy

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

obs = copy.copy(h)

for i in range(m):
	a, b = map(int, input().split())
	a -= 1
	b -= 1
	
	height = max(obs[a], obs[b])
	obs[a] = height
	obs[b] = height
	#print(obs)

ans = 0

for i in range(n):
	if obs[i] == h[i]:
		ans += 1

print(ans)
n, m = list(map(int, input().split()))
hs =  list(map(int, input().split()))
ans = [1]*n
for i in range(m):
    road = list(map(int, input().split()))
    if hs[road[0]-1] <= hs[road[1]-1]:
        ans[road[0]-1] = 0
    if hs[road[0]-1] >= hs[road[1]-1]:
        ans[road[1]-1] = 0
print(ans.count(0))
#coding: utf-8
#coding: utf-8
N, M = map(int, input().split())
H = list(map(int, input().split()))
d = {i:H[i-1] for i in range(1, N+1)}
for i in range(M):
    a, b = map(int, input().split())
    d[a] = max(d[a], H[b-1])
    d[b] = max(d[b], H[a-1])
ans = 0
# print(d.values())
for i in range(N):
    if d[i+1] == H[i]:
        ans += 1
print(ans)
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0]]*n
for i in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
print(c)
n, m = map(int, input().split())
h = list(map(int, input().split()))
l = [0] * n
for i in range(m):
  a, b = map(int, input().split())
  l[a-1] = max(h[a-1], h[b-1])
  l[b-1] = max(h[a-1], h[b-1])  
s = set(l)
if 0 in s:
  print(len(s) - 1)
else:
  print(len(s))
import copy
n,m=map(int,input().split())
h=[0]+list(map(int,input().split()))
hh=copy.copy(h)
for i in range(m):
  a,b=map(int,input().split())
  if h[a]>h[b]:
    h[b]=h[a]
  elif h[a]<h[b]:
    h[a]=h[b]
cnt=0
for j in range(1,n+1):
  if h[j]==hh[j]:
    cnt+=1
print(cnt)
N,M = map(int,input().split())
H = list(map(int,input().split()))
XX = [set() for i in range(N)]
ans = 0
for i in range(M):
  A,B = map(int,input().split())
  XX[A-1].add(B-1)
  XX[B-1].add(A-1)
  
for i in range(N):
  for y in XX[i]:
    r = True
    if H[i]<=H[y]:
      r = False
      break
    if r:
      ans += 1

print(ans)
import numpy as np

N, M = input().split()
H = np.array(input().split())
canGoH = np.copy(H)
             
for i in range(int(M)):
    position1, position2 = input().split()
    if H[int(position1)-1] > H[int(position2)-1]:
        canGoH[int(position2)-1] = H[int(position1)-1]
    elif H[int(position2)-1] > H[int(position1)-1]:
        canGoH[int(position1)-1] = H[int(position2)-1]

        
print(sum(canGoH == H))
n,m = map(int,input().split())
H = list(map(int,input().split()))
ans = []
cut =[]
for i in range(m):
  a,b = map(int,input().split())
  ans.append(a)
  ans.append(b)
  if a in cut:
    cut.append(a)
  else:
    cut.append(min(a,b))
    
ansset = set(ans)
cutset = set(cut)

print(len(ansset)-len(cutset))
N, M = map(int, input().split())
h = list(map(int, input().split()))
li = []
for m in range(M):
  a, b = map(int, input().split())
  if h[a-1] < h[b-1]:
    li.append(a)
  if h[a-1] == h[b-1]:
    li.append(a)
    li.append(b)
  else:
    li.append(b)

answer = N - len(set(li))
print(answer)
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]

cnt = 0

s = set()
used = set()
for i in range(M):
    lef = AB[i][0]-1
    rig = AB[i][1]-1
    if not H[lef] == H[rig]:
        s.add(max(H[lef], H[rig]))
        used.add(H[lef])
        used.add(H[rig])

cnt = len(set(H)) - len(used)
print(len(s)+cnt)
n,m=map(int,input().split())
h=list(map(int,input().split()))
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    h[b-1]=0
  elif h[a-1]<h[b-1]:
    h[a-1]=0
print(n-h.count(0))
N, K = map(int,input().split())
H = list(map(int,input().split()))
s = {}
for j in range(K):
  A, B = map(int,input().split())
  if H[A-1] < H[B-1]:
    s[A] = False
    s[B] = True
  else:
    s[A] = True
    s[B] = False
    
cnt = 0
for i in s:
  if s[i]:
    cnt += 1
print(cnt)
n, m =map(int,input().split())
s = list(map(int,input().split()))
a = []*m
b = []*m
ans = 0
for __ in range(m):
  _= list(map(int, input().split()))
  a.append(_)
  if s[_[0]-1] > s[_[1]-1]:
    b.append(_[0])
  elif s[_[0]-1] < s[_[1]-1]:
    b.append(_[1])
  else:
    b.append(0)
for i in range(n):
  count = 0
  for j in range(m):
    if i+1 in a[j]:
      count += 1
  if b.count(i+1) == count:
      ans += 1
      print(str(i+1) +" is good")
print(ans)
N,M = map(int,input().split(' '))
H = [int(i) for i in input().split(' ')]
AB = []
for i in range(M):
    A,B = map(int,input().split(' '))
    AB.append(max(H[A-1],H[B-1]))
print(len(set(AB)))
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
for i in range(M):
  a, b = (map(int, input().split()))
  A.append(a)
  B.append(b)

flg = [1] * N
for i in range(M):
  if flg[A[i]-1] == 1 and H[A[i]-1] < H[B[i]-1]:
    flg[A[i]-1] = 0

for i in range(M):
  if flg[B[i]-1] == 1 and H[A[i]-1] > H[B[i]-1]:
    flg[B[i]-1] = 0

print(sum(flg))
n,m = map(int, input().split())
A = []
B = []
ans = 0
H = list(map(int,input().split()))
for i in range(m-1):
    a, b = map(int, input().split())
    A.append(int(a))
    B.append(int(b))
for i in range(m-1):
  if H[(A[i])-1] < H[(B[i])-1]:
    ans += 1
for i in range(m-1):
  if A.count(i) == 0 and B.count(i) == 0:
    ans += 1
for i in range(m-1):
  for j in range(m-1):
    if A[i] == B[j] and B[i] == A[j]:
      ans += 1
print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
count=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1]:
    count[b-1]=0
  elif h[a-1]==h[b-1]:
    count[a-1]=0
    count[b-1]=0
  else:
    count[b-1]=0
print(sum(count))
N,M = map(int,input().split())
H = list(map(int,input().split()))
H = [0] + H
Tree = [0] + [1]*N
for _ in range(M):
  A,B = map(int,input().split())
  if H[A] >= H[B]:
    Tree[B] = 0
  else:
    Tree[A] = 0
print(sum(H))
import collections

n, m = map(int, input().split())
h = list(map(int, input().split()))
sum_tenboudai = [1] * n

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

sum_counter = collections.Counter(sum_tenboudai)
print(sum_counter[1])
def main():
    n, m = map(int, input().strip().split())
    h = list(map(int, input().strip().split()))

    flg = [True] * n

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

    print(flg.count(True))

main()
N, M = map(int, input().split())
H = list(map(int, input().split()))
A, B = [], []

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

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

r = [1] * len(H)
a = []
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        r[B - 1] = 0
    if H[B - 1] > H[A - 1]:
        r[A - 1] = 0

print(r.count(1))
n, m = map(int,input().split())

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

temp_h = h.copy()

for _ in range(m):
    x1, x2 = map(int,input().split())

    temp_h[x1 - 1] = max([temp_h[x1 - 1], h[x2 - 1]])
    temp_h[x2 - 1] = max([h[x1 - 1], temp_h[x2 - 1]])

res = [1 if x - y else 0 for x, y in zip(h, temp_h)]

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

X = [1]*N
for i in range(M):
    a,b = map(int,input().split())
    x1 = H[a-1]
    x2 = H[b-1]
    if x1 < x2:
        X[a-1] = False
        if X[b-1] != False:
            X[b-1] = True

    else:
        X[b-1] = False
        if X[a-1] != False:
            X[a-1] = True
print(X.count(True))
N, M= (int(x) for x in input().split())
height=[int(x) for x in input().split()]
nlist=[1]*N
print(nlist)

for _ in range(M):
    a, b =(int(x) for x in input().split())
    a-=1
    b-=1
    if height[a]<height[b]:
        nlist[a]=0

    if height[b]<height[a]:
        nlist[b]=0
    print(nlist)

print(sum(nlist))
N,M=map(int,input().split())
listH=list(map(int,input().split()))
listN=list(range(N))
for i in range(M):
  A,B=map(int,input().split())
  if listH[A-1]>listH[B-1]:
    listN[B-1]=-1
  if listH[A-1]<listH[B-1]:
    listN[A-1]=-1
  else:
    listN[A-1]=-1
    listN[B-1]=-1 
ans=0    
for i in listN:
  if i>=0:
    ans+=1
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split())) 
A = [0]*M
B = [0]*M
for i in range(M):
    A[i], B[i] = map(int, input().split())
    A[i] -= 1
    B[i] -= 1
lis = [0]*M
for i in range(M):
    lis[i] = max(H[A[i]],H[B[i]])
print(len(set(lis)))
n,m = map(int,input().split())
h = input().split(" ")
hlist = [int(n) for n in h]
alist = [int(n) for n in h]
for i in range(m):
  b = input().split(" ")
  blist = [int(n) for n in b]
  if hlist[blist[0]-1]>hlist[blist[1]-1] and hlist[blist[1]-1] in alist:
      alist.remove(hlist[blist[1]-1])
  if hlist[blist[1]-1]>hlist[blist[0]-1] and hlist[blist[0]-1] in alist:
      alist.remove(hlist[blist[0]-1])
kotae = len(alist)
print(kotae)
import numpy as np

N,M=map(int,input().split())
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

ok=np.zeros(N)
for i in range(M):
    if H[A[i][0]-1]>H[A[i][1]-1]:
        ok[A[i][0]-1]=1
        ok[A[i][1]-1]=0
    else:
        ok[A[i][1]-1]=1
        ok[A[i][0]-1]=0
print(int(np.sum(ok)))
N, M = map(int, input().split())
H_li = list(map(int, input().split()))

par = [i + 1 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    if H_li[par[A-1]-1] > H_li[par[B-1]-1]:
        par[B-1] = par[A-1]
    else:
        par[A-1] = par[B-1]

par = set(par)
print(len(par))
N, M = map(int, input().split())
c = [0 for _ in range(N)]
H = list(map(int, input().split()))

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

print(c.count(1))
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7

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

print (sum(ok))
import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 62


def lmi():
    return list(map(int, input().split()))


def llmi(n):
    return [lmi() for _ in range(n)]


N, M = lmi()
H = lmi()

AB = llmi(M)
flag = [1] * N
for a, b in AB:
    a = a - 1
    b = b - 1
    ha = H[a]
    hb = H[b]
    if ha >= hb:
        flag[b] = 0
    elif hb >= ha:
        flag[a] = 0
print(sum(flag))
int1 = lambda x: int(x) - 1

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

nei = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int1, input().split())
    nei[A].append(B)
    nei[B].append(A)

good = [True] * N

for i in range(N):
    if good[i]:
        for n in nei[i]:
            if H[i] <= n:
                good[i] = False
                break
            else:
                good[n] = False

print(sum(good))
N, M = map(int, input().split())
H = input().split()
ans = [1] * N

# print(H)
for i in range(M):
    a, b = map(int, input().split())
    AH = H[a - 1]
    BH = H[b - 1]
    if AH >= BH:
        ans[b - 1] = 0
    if BH >= AH:
        ans[a - 1] = 0


print(ans.count(1))
temp = input()
temp = temp.split()
N = int(temp[0])
M = int(temp[1])

temp = input()
temp = temp.split()
height = [int(s) for s in temp]
bridge = [0] * N
data = [0] * N

for i in range(M):
  temp = input()
  temp = temp.split()
  A = int(temp[0])
  B = int(temp[1])
  if height[A-1] > height[B-1]:
    data[A-1] = 1
  else:
    data[B-1] = 1
  bridge[A-1] = 1
  bridge[B-1] = 1

count = 0
for i in range(N):
  if data[i] == 0 or bridge[i] == 0:
    count += 1
print(count)
n,m=map(int,input().split())
li_h=list(map(int,input().split()))
li_pair=[]
ans=0
for i in range(n):
    li_pair.append([])
for s in range(m):
    li=list(map(int,input().split()))
    li_pair[li[0]-1].append(li[1]-1)
    li_pair[li[1]-1].append(li[0]-1)
for i in range(n):
    lis=li_pair[i]
    if len(lis) != 0:
        if li_h[i]>max(lis):
            ans+=1
        else:
            ans+=0
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))
HC = [0]*N
c = 0
for i in range(M):
    A,B = map(int, input().split())
    if H[A-1]<H[B-1]:
        HC[A-1] -= 1
    else:
        HC[B-1] -= 1
print(HC.count(0))
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [-1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 1
    else:
        ans[pairs[i][0] - 1] = 1
        ans[pairs[i][1] - 1] = 0      

for i in range(n):
    if ans[i] == -1:
        ans[i] = 1
    
print(sum(ans))
n,m =map(int,input().split())

H=[]
H=list(map(int,input().split()))
C=[]
for i in range(n):
    C.append(1)

for i in range(m):
    a,b = map(int,input().split())
    if H[a-1]<H[b-1] :
        C[a-1] = 0
    else:
        C[b-1] = 0

print( C.count(1))
n, m = map(int, input().split())
H = list(map(int, input().split()))
road = [0 for i in range(m)]
ans = [0] * n

for i in range(m):
    road[i] = list(map(int, input().split()))

for j in range(m):
    if H[road[j][0]-1] <= H[road[j][1]-1]:
        ans[road[j][0]-1] = 1
    if H[road[j][0]-1] == H[road[j][1]-1]:
        ans[road[j][1]-1] = 1

total = sum(ans)
print(n-total)
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1 for i in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  if h[a] >= h[b]:
    ans[b] = 0
  elif h[b] >= h[a]:
    ans[a] = 0
    
print (sum(ans))
mounten_num, bridge_num = map(int, input().split())
mounten_higests = list(map(int, input().split()))
mounten_higests.sort(reverse=True)
bridges = []
good_mountens = []

# inputをさばく
for i in range(bridge_num):
    bridge = list(map(int, input().split()))
    bridge.sort()
    bridges.append(bridge)

# good_mountensとつながる橋がなければその山はgood_mounten
for j in mounten_higests:
    for k in good_mountens:
        if [j, k] in bridges:
            break
    else:
        good_mountens.append(j)

print(len(good_mountens))
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
    else:
        ans[b-1] = 1

print(ans.count(1))
n,m = list(map(int, input().split()))
i = list(map(int, input().split()))
k=i
ans=0
for j in range(m):
    a,b = list(map(int, input().split()))
    if i[a-1]==i[b-1]:
        k[a-1]=0
        k[b-1]=0
    else:
        if i[b-1]>i[a-1]:
            k[a-1]=0
        else:
            k[b-1]=0
            
for w in range(n):
    if k[w]!=0:
        ans+=1
print(ans)
N, M = map(int, input().split())
Hlist = list(map(int, input().split()))
ABList = []


for i in range(M):
    a, b = map(int, input().split())
    ABList.append([a, b])

anslist = [False]*N
for i in range(N):
    for ab in ABList:
        if ab[0] == i+1:
            if Hlist[ab[1]-1] >= Hlist[i]:
                anslist[i] = True
        if ab[1] == i+1:
            if Hlist[ab[0]-1] >= Hlist[i]:
                anslist[i] = True


print(anslist.count(True))
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
    if h[a-1] <= h[b-1]:
        ans[b-1] = 1

print(ans.count(1))
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n,m=map(int,input().split())
    H=[int(_) for _ in input().split()]
    HH= [0]*n

    for i in range(m):
        a,b=map(int,input().split())
        HH[a-1]=max(HH[a-1],H[b-1])
        HH[b-1]=max(HH[b-1],H[a-1])
    ans=0
    for i,hh in enumerate(HH):
        if H[i]>hh or hh==0:
            ans+=1
    print(HH)
    print(ans)

if __name__=='__main__':
    main()
N, M = map(int, input().split())
H = tuple(map(int, input().split()))

T = [set() for _ in range(N)]

for _ in range(M):
    a, b = map(int, input().split())
    T[a-1].add(H[b-1])
    T[b-1].add(H[a-1])

count = 0
for i, t in enumerate(T):
    if not t:
        continue
    h = H[i]
    if h >= max(t):
        count += 1

print(count)
#! /usr/bin python3
N, M = map(int, input().split())
H = list(map(int, input().split()))

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

print(check.count(1))
N, M = map(int, input().split(' '))
HList = [0]*N
ansList=[1]*N
Hcount=0
for H in input().split():
    HList[Hcount]=H
    Hcount=Hcount+1

for i in range(M):
    A, B = map(int, input().split())
    if HList[A-1] > HList[B-1]:
        ansList[B-1] = 0

    elif HList[A-1] < HList[B-1]:
        ansList[A-1] = 0

    elif HList[A-1] == HList[B-1]:
        ansList[A-1] = 0
        ansList[B-1] = 0
print(ansList.count(1))
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0]]*n
 
for _  in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
 
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
 
print(c)
n,m=map(int,input().split())
h=list(map(int,input().split()))
l=0
for _ in range(m):
  a,b=map(int,input().split())
  if(h[a-1]>h[b-1]):
    l+=1
  elif(h[a-1]<h[b-1]):
    l+=1
print(l)
N,M=map(int,input().split())
H=list(map(int,input().split()))
Obs={i:0 for i in range(1,N+1)}
AB=[]
for i in range(M):
  AB.append(tuple(map(int,input().split())))
for i in range(M):
  if(H[AB[i][0]-1]>H[AB[i][1]-1]):
    Obs[AB[i][0]]=1
    Obs[AB[i][1]]=0
  else:
    Obs[AB[i][1]]=1
    Obs[AB[i][0]]=0
print(sum(list(Obs.values())))
N,M = map(int,input().split())
H=list(map(int,input().split()))
ABmap=[[] for i in range(N)]
count=0
for i in range(M):
    A,B=map(lambda x:x-1,map(int,input().split()))
    ABmap[A].append(H[B])
    ABmap[B].append(H[A])
        
for i in range(N):
    if len(ABmap[i])==0:
        count+=1
    elif max(ABmap[i])<H[i]:
        count+=1
   # print(ABmap[i])
    #print(count)