peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import defaultdict
n,m=map(int,input().split())
d=defaultdict(list)
l=list(map(int,input().split()))
for i in range(1,n):
	d[i].append(0)

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

count_obs=0
for keys,values in d.items():
	r=l[keys-1]
	count=0
	
	#print(r)
	#print(values)
	if len(values)==1:
		count_obs+=1
	else:
		for j in range(1,len(values)):
			if r>l[values[j]-1]:
				count+=1
		if count==len(values)-1:
			count_obs+=1


		
print(count_obs)
N, M = (int(x) for x in input().split())
H=list(map(int, input().split()))
check=[True]*N
ans=N
for i in range(M):
  A, B = (int(x) for x in input().split())
  if check[A-1]==True and H[A-1]<=H[B-1]:
    check[A-1]=False
    ans-=1
  elif check[B-1]==True and H[A-1]>=H[B-1]:
    check[B-1]=False
    ans-=1
print(ans)
from copy import deepcopy
n,m=map(int,input().split())
h=[0]+list(map(int,input().split()))
l=[]
g=[i for i in range(0,n+1)]
for _ in range(m):
    l.append(list(map(int,input().split())))

for j in range(m):
    if h[l[j][1]]>h[l[j][0]]:
        g[l[j][0]]=g[l[j][1]]
    else:
        g[l[j][1]]=g[l[j][0]]
print(len(set(g))-1)
N, M = map(int, input().split())
height = list(map(int,input().split()))
def loadmake(a, b, load):
    if a in load.keys():
        load[a].append(b)
    else:
        load[a] = [b]
load = {}
for m in range(M):
    a, b = map(int, input().split())
    loadmake(a-1, b-1, load)
    loadmake(b-1,a-1,load)
oklist = [1]*N
for n in range(N):
  if n in load.keys():
    for l in load[n]:
        if height[l] > height[n]:
            oklist[n] = 0
  else:
  	oklist[n] = 0
print(sum(oklist))
import numpy as np
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
G = N
lists = np.zeros(N)
for i in range(M):
    A, B = list(map(int, input().split()))
    if H[A-1] < H[B-1]:
        lists[A-1] = 1
    else:
        lists[B-1] = 1
for i in range(N):
    if lists[i] == 1:
        G -= 1
print(G)
n,m = map(int,input().split())
h = list(map(int,input().split()))
c = dict()
for i in range(m):
    a, b = map(int,input().split())
    if a in c:
        c[a].append(b)
    else:
        c[a] = [b]
    if b in c:
        c[a].append(a)
    else:
        c[b] = [a]
        
cnt = n
for k,v in c.items():
    for i in range(len(v)):
        if h[v[i] - 1] >= h[k - 1]:
            cnt -= 1
            break
print(cnt)
N, M = map(int,input().split())
H = list(map(int,input().split()))
l = []
count = 0
for _ in range(M):
    A, B = map(int,input().split())
    if B not in l:
        if H[A-1] < H[B-1]:
            count +=1
    if A not in l:
        if H[A-1] > H[B-1]:
            count +=1
    l.append(A)
    l.append(B)
print(count)
lis = input().split()
N = int(lis[0])
M = int(lis[1])
H = input().split()
T = list(range(N+1))

for i in range(M):
    R = input().split()
    r1 = int(R[0])-1
    r2 = int(R[1])-1
    #print("r1=",r1,"r2=",r2)
    if int(H[r1]) >= int(H[r2]):
        if int(r2+1) in T:
            T.remove(int(r2+1))
    if int(H[r1]) < int(H[r2]):
        if int(r1+1) in T:
            T.remove(int(r1+1))

print(len(T) - 1)
from math import factorial
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
good = []
tmp = []

for i in range(m):
  a,b = map(int,input().split())
  
  tmp.append(a)
  tmp.append(b)
  a_num = h[a-1]
  b_num = h[b-1]
  if a_num > b_num:
    good.append(a)
  elif b_num > a_num:
    good.append(b)

result = len(set(good))

if (n-len(set(tmp))) > 0:
  result += n-len(set(tmp))
  
print(result)
import collections
n,m=map(int,input().split())
H=list(map(int,input().split()))
blacklist=[]
Li=[]
for i in range(m):
    a,b=map(int,input().split())
    if [a,b] not in Li:
        Li.append([a,b])
        Ha,Hb=H[a-1],H[b-1]
        if Ha<Hb:
            blacklist.append(a)
        else:
            blacklist.append(b)
ans=0
cbl=collections.Counter(blacklist)
for j in range(1,n+1):
    if cbl[j]==0:
        ans+=1
print(ans)
N,M = list(map(int, input().split()))
H = list(map(int, input().split()))

anslist = [] * M

for _ in range(M):
    a,b = list(map(int, input().split()))
    if a > b:
        anslist.append(a)
    else:
        anslist.append(b)

nums_unique = list(set(anslist))
print(len(nums_unique))
n,m = map(int, input().split())
h = list(map(int, input().split()))
A = [1 for i in range(n)]

for i in range(m):
    a = list(map(int, input().split()))
    #print(a)
    #print(h)
    if h[a[0]-1] < h[a[1]-1]:
        A[a[0]-1] = 0
    else:
        A[a[1]-1] = 0

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

ans_list=list(range(1,N+1))

for i in range(M):
    a,b=map(int,input().split())
    if H[a-1]<H[b-1]:
        if a in ans_list:
            ans_list.remove(a)
    if H[a-1]>H[b-1]:
        if b in ans_list:
            ans_list.remove(b)
print(len(ans_list))
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())
  if H[A-1]>H[B-1]:
    ans[A-1]=1
    ans[B-1]=0
  elif H[A-1]<H[B-1]:
    ans[A-1]=0
    ans[B-1]=1
  else:
    ans[A-1]=0
    ans[B-1]=0
print(ans.count(1))
import numpy as np

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

map_ = {str(i):[] for i in range(n)}

for _ in range(m):
  a, b = map(int, input().split())
  map_[str(a-1)].append(b-1)
  map_[str(b-1)].append(a-1)
  
cnt=0
for i in range(n):
  tmp = [h_list[i]] + [h_list[j] for j in map_[str(i)]]
  if tmp.index(max(tmp))==0:
    cnt+=1
print(cnt)
n,m = map(int,input().split())
lis1 = list(map(int, input().split()))
ans = []
for i in range(n):
    ans.append(1)

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

print(sum(ans))
N, M = map(int, input().split(" "))
Hs = list(map(int, input().split(" ")))
candidate = set(range(1, N+1))
for _ in range(M):
    i, j = map(int, input().split(" "))
    if Hs[i - 1] >= Hs[j - 1]:
        # jは良い展望台ではない
        candidate.discard(j)
    elif Hs[j - 1] >= Hs[i - 1]:
        # iは良い展望台ではない
        candidate.discard(i)
        
print(len(candidate))
import sys
import math
import itertools

n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [True] * n
lis = [] * n
for i in range(len(h)):
    lis.append(h[i])
print(lis)
for i in range(m):
    a, b = map(int, input().split())
    lis[a - 1] = max(lis[a - 1], lis[b - 1])
    lis[b - 1] = max(lis[b - 1], lis[a - 1])
ans = 0
for i in range(n):
    if lis[i] == h[i]:
        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]
        #canGoH[int(position1)-1] = 0
    else:
        canGoH[int(position1)-1] = H[int(position2)-1]
        #canGoH[int(position2)-1] = 0

        
print(sum(canGoH > H))
n, m = map(int, input().split())
h = []
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[b-1] = 1
  if h[a-1] < h[b-1]:
    ans[a-1] = 1
  else:
    ans[a-1] = 1
    ans[b-1] = 1

print(ans.count(1))
N, M = map(int,input().split())
Hs = list(map(int,input().split()))
L = [[] for i in range(N)]
count = 0
for i in range(M):
    A, B = map(int,input().split())
    (L[A-1]).append(Hs[B-1])
    (L[B-1]).append(Hs[A-1])
for i in range(N):
    if not L[i]:
        count+=1
        continue
    if i+1 > max(L[i]):
        count += 1
print(count)
n,m = map(int,input().split())
h = list(map(int,input().split()))

check = [True] * n #小さかったらfalseに
for i in range(m):
    print(i)
    a,b = (map(int,input().split()))
    if h[a-1] > h[b-1]:
        check[b-1] = False
    elif h[a-1] < h[b-1]:
       # print("i,check",i,check)
        check[a-1] = False
    else:
        check[a-1] = False
        check[b-1] = False
print(sum(check))
N, M = map(int, input().split(" "))
height = list(map(int, input().split(" ")))
flag = [1 for i in height]
for i in range(M):
  a, b = map(int, input().split(" "))
  if height[a - 1] > height[b - 1]:
    flag[b - 1] = 0
  elif height[b - 1] > height[a - 1]:
    flag[a - 1] = 0
print(sum(flag))
N,M = list(map(int,input().split()))
higher = list(map(int,input().split()))
safety = [0] * (N+1)
for i in range(M):
    B = list(map(int,input().split()))
    if higher[B[0]-1] > higher[B[1]-1]:
        safety[B[1]] = 1
    else:
        safety[B[0]] = 1
print(sum(safety))
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N, M = lr()
    H = lr()
    road = [-1]*N
    for i in range(M):
        a, b = lr()
        mab = max(H[a-1], H[b-1])
        road[a-1] = max(mab, road[a-1])
        road[b-1] = max(mab, road[b-1])
    ans = 0
    for i in range(N):
        if road[i] == H[i] or road[i] == -1:
            ans += 1
    print(ans)
resolve()
n,m=map(int,input().split())
h=list(map(int,input().split()))
ab=[list(map(int,input().split())) for i in range(m)]
d=[ [] for i in range(n+1)]
for i in range(m):
  #a=ab[i][0]
  #b=ab[i][1]
  d[ab[i][0]].append(h[ab[i][1]-1])
  d[ab[i][1]].append(h[ab[i][0]-1])
count=0
for i in range(0,len(d)-1):
  if len(d[i+1])==0:
    count+=1
  elif h[i]<max(d[i+1]):
    count+=1
print(count)
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = [0] * M
B = [0] * M
tower = [0] * N
ans = 0
for _ in range(M):
    A[_], B[_] = map(int, input().split())

for i in range(M):
    tower_a = A[i] - 1
    tower_b = B[i] - 1
    if H[tower_a] > H[tower_b]:
        tower[tower_a] = 1
        tower[tower_b] = 0
    else:
        tower[tower_a] = 0
        tower[tower_b] = 1

ans = sum(tower)
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]
        canGoH[int(position1)-1] = 0
    else:
        canGoH[int(position1)-1] = H[int(position2)-1]
        canGoH[int(position2)-1] = 0

        
print(sum(canGoH >= H))
import copy
N, M = map(int, input().split())
H = list(map(int, input().split()))
RH = copy.copy(H)
for j in range(M):
  a, b = map(int, input().split())
  ah = H[a-1]
  bh = H[b-1]
  if ah > bh:
    if RH[a-1] == 0: RH[a-1] = ah
    RH[b-1] = 0
  elif bh > ah:
    if RH[b-1] == 0: RH[b-1] = bh
    RH[a-1] = 0
  else:
    RH[a-1] = 0
    RH[b-1] = 0
    continue
ans = list(set(RH))
print(len(ans)-1)
N ,M = map(int, input().split())
H = [int(i) for i in input().split()]
X = []
cnt = 0

for i in range(M):
    A = [int(i) for i in input().split()]
    if H[A[0] - 1] < H[A[1] - 1]:
        X.append(A[0])
    elif H[A[0] - 1] > H[A[1] - 1]:
        X.append(A[1])
    else:
        X.append(A[0])
        X.append(A[1])

for i in range(N):
    if X.count(i+1) == 0:
        cnt += 1
        
print(N - 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[a-1]=0
        h[b-1]=0
    else:
        if h[b-1]>h[a-1]:
            h[a-1]=0
        else:
            h[b-1]=0

print(n-h.count(0))
N, M = map(int, input().split())
H = [int(x) for x in input().split()]

c_arr = []
for i in H:
    c_arr.append(True)

for i in range(M):
    a_, b_ = map(int, input().split())
    if H[a_-1] < H[b_-1]:
        c_arr[a_-1] = False
    else:
        c_arr[b_-1] = False

c = 0
for i in c_arr:
    if i:
        c = c + 1

print(c)
n, m = list(map(int, input().split()))
heights = list(map(int, input().split()))
roads = [list(map(int, input().split())) for i in range(m)]

arrows = [True] * n

for road in roads:
    if heights[road[0] - 1] < heights[road[1] - 1]:
        res = [False, True]
    else:
        res = [True, False]
    arrows[road[0] - 1] &= res[0]
    arrows[road[1] - 1] &= res[1]

print(len([i for i in arrows if i]))
n, m = map(int,input().split())
graph = {i:[] for i in range(n)}
H = list(map(int,input().split()))
for _ in range(m):
  a,b = map(int,input().split())
  a, b = a-1, b-1
  
  if H[a]<H[b]:
    graph[a].append(b)
  elif H[b]>H[a]:
    graph[b].append(a)
  else:
    graph[a].append(b)
    graph[b].append(a)
    
ans = 0

for i in range(n):
  if len(graph[i]) ==0:
    ans += 1
print(ans)
def main():
    N, M = map(int, input().split())
    HN = list(map(int, input().split()))

    temp = [True for _ in range(N)]
    for _ in range(M):
        A, B = map(int, input().split())

        if HN[A - 1] < HN[B - 1]:
            temp[A - 1] = False
        else:
            temp[B - 1] = False

    print(sum([1 for a in temp if a]))


main()
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[a - 1] = 0
    elif h[b - 1] <= h[a - 1]:
        l[b - 1] = 0
        
print(sum(l))
N,M = map(int,input().split())
H = list(map(int,input().split()))
from collections import defaultdict
dic = defaultdict(list)
for _ in range(M):
  a, b = map(int,input().split())
  dic[a].append(b)
  dic[b].append(a)
counter = 0
for item in dic:
  if max(dic[item]) <= H[item - 1]:
    counter +=1
print(counter)
N, M = map(int, input().split())
H = list(map(int,input().split()))
Road = [sorted(list(map(int, input().split()))) for _ in range(M)]
num = N
Mem = [0 for _ in range(N)]
for j in range(M):
  if H[Road[j][0]-1] >= H[Road[j][1]-1] and not Mem[Road[j][1]-1] == 1:
    num -= 1
    Mem[Road[j][1]-1] = 1
  elif H[Road[j][1]-1] >= H[Road[j][0]-1] and not Mem[Road[j][0]-1] == 1:
    num -= 1
    Mem[Road[j][0]-1] = 1

print(num)
import math
from collections import Counter
n,m=map(int,input().split())
e=[int(x) for x in input().split()]
di={}
for i in range(m):
	a,b=map(int,input().split())
	if a in di:
		di[a]+=[b]
	else: di[a]=[b]
	if b in di:
		di[a]+=[a]
	else: di[b]=[a]

c=0
for u,v in di.items():
	h=e[u-1]
	f=False
	for i in v:
		if h<=e[i-1]:
			f=True
			break
	if not f:
		c+=1
for i in range(1,len(e)+1):
	if i not in di:
		c+=1
print(c)
n,m = map(int,input().split())
h = list(map(int,input().split()))

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

ans = []

for i in range(m):
    if h[a[i][0]-1] < h[a[i][1]-1]:
        ans.append(a[i][1]-1)
    else:
        ans.append(a[i][0]-1)
    
ans = set(ans)

print(len(ans))
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
a = [0] * m
b = [0] * m
for i in range(m):
    a[i],b[i] = map(int,input().split())

c = [0] * n
for i in range(n):
    c[i] = i+1

for j in range(m):
    if h[a[j]-1] >= h[b[j]-1]:
        if b[j] in c:
            c.remove(b[j])
    elif h[b[j]-1] >= h[a[j]-1]:
        if a[j] in c:
            c.remove(a[j])

print(len(c))
from math import factorial
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
good = []
#出てきた数字を記録
tmp = []

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

for i in range(n):
  if i not in tmp:
    good.append(i)

print(len(set(good)))
from collections import defaultdict

d = defaultdict(list)

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

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

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

ans = 0
for i in range(N):
    ng = 0

    if(not d[i]):
        ans += 1
        break

    for j in d[i]:
        if(H[i] <= H[j]): ng = 1
    if(ng != 1):
        ans += 1

print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
memo = [[] for _ in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    memo[a].append(b)
    memo[b].append(a)
    
#print(memo)
count = 0
for i in range(1,N+1):
    mini = set(memo[i])
    if len(mini) > 0:
        for j in mini:
            if H[i-1] < H[j-1]:
                break
        else:
            count += 1

print(count)
n, m = map(int, input().split())
h = map(int, input().split())
a = []
for i in range(m):
    a += map(int, input().split())
division = n // 2
print(division)
n,m = list(map(int, input().split()))
h = list(map(int, input().split()))
nice = list(1 for i in range(n))
def chk_nice(x,y): 
    global nice
    nice[x] = (h[x] > h[y])
for i in range(m):
    a,b = list(map(int, input().split()))
    chk_nice(a-1, b-1)
    chk_nice(b-1, a-1)
print(sum(nice))
n,m=map(int,input().split())
h=list(map(int,input().split()))
ans=[]
hold=[]
for i in range(0,m):
  a,b=map(int,input().split())
  hold+=[a,b]
  if(h[a-1]>h[b-1]):
    ans.append(a)
  elif(h[a-1]<h[b-1]):
    ans.append(b)
ans=set(ans)
hold=set(hold)
print(len(ans)+(n-len(hold)))
n,m=map(int, input().split())
h=list(map(int,input().split()))
nl=[0]*(n+1)
check=[0]*(n+1)

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

print(sum(nl)+(n-sum(check)))
import numpy as np
argList = list(map(int, input().split())) 
heights = list(map(int, input().split())) 

#いい展望台フラグ
check = np.array([1]*argList[0])

for n in range(argList[1]):
    #どことどこをつないでいるか
    con = list(map(int, input().split())) 
    #低かったらいい展望台ではない
    if heights[con[0]-1] < heights[con[1]-1]:
        check[con[0]-1] = 0
    if heights[con[0]-1] > heights[con[1]-1]:
        check[con[1]-1] = 0
print(np.sum(check))
N, M = map(int, input().split())
H = list(map(int, input().split()))
Hi = [1]*N
AB = [list(map(int, input().split())) for _ in range(M)]

for i in range(M):
    if H[AB[i][0]-1] > H[AB[i][1]-1]:#dictにするか？
        Hi[AB[i][1]-1] = 0
    else:
        Hi[AB[i][0]-1] = 0
print(sum(Hi))
import collections

N, M = map(int,input().split())
Hl = list(map(int,input().split()))
l0 = [1]*N
Hd = dict(zip(Hl,l0))

for i in range(M):
    A, B = map(int,input().split())
    if A > B:
        Hd[B] = 0
    else:
        Hd[A] = 0

count = 0
for value in Hd.values():
    count += value

print(count)
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(' '))
    if H[A-1] == H[B-1]:
        continue
    elif max(H[A-1],H[B-1]) == H[A-1]:
        AB.append(A)
    else:
        AB.append(B)
        
print(len(set(AB)))
n,m=map(int,input().split())
h=list(map(int,input().split()))

ab=[list(map(int,input().split())) for _ in range(m)]

a=[1]*n
for i in range(m):
    if h[ab[i][0]-1]<h[ab[i][1]-1]:
        a[ab[i][1]-1]=0
    else:
        a[ab[i][0]-1]=0
print(sum(a))
N,K = map(int, input().split())
H = list(map(int, input().strip().split()))
A = []
for i in range(0,K):
    array = list(map(int, input().strip().split()))
    A.append(array)
des = []
for i in range(0,K):
    print(H[A[i][0]-1])
    print(H[A[i][1]-1])
    if(H[A[i][0]-1] > H[A[i][1]-1]):
       des.append(H[A[i][1]-1])
    else:
        des.append(H[A[i][0]-1])
ans = sorted(set(des), key=des.index)
print(N-len(ans))
import numpy as np

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

map_ = {str(i):[] for i in range(n)}

for _ in range(m):
  a, b = map(int, input().split())
  map_[str(a-1)].append(b-1)
  map_[str(b-1)].append(a-1)
  
cnt=0
for i in range(n):
  tmp = [h_list[i]] + [h_list[j] for j in map_[str(i)]]
  hiest = max(tmp)
  if tmp.count(hiest)!=1:
    break
  else:
    if tmp.index(max(tmp))==0:
      cnt+=1
print(cnt)
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)
        
    elif 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)
n,m=map(int,input().split())
h=list(map(int,input().split()))
road=[]
for i in range(m):
    road.append(list(map(int,input().split())))
tall=[1 for _ in range(n)]
for i in range(m):
    if h[road[i][0]-1]>=h[road[i][1]-1]:
        tall[road[i][1]-1]=0
    elif h[road[i][0]-1]<=h[road[i][1]-1]:
        tall[road[i][0]-1]=0
counter=0
for i in range(n):
    if tall[i] == 1:
        counter+=1
print(counter)
s = input()

N = int(s.split()[0])
M = int(s.split()[1])

H = input().split()

tenbo = []
for i in range(N):
  tenbo.append(i+1)

for i in range(M):
  road = input().split()
  A = int(road[0])
  B = int(road[1])
  HA = int(H[A-1])
  HB = int(H[B-1])
  if HA > HB and B in tenbo:
    tenbo.remove(B)
  if HA < HB and A in tenbo:
    tenbo.remove(A)
    
print(len(tenbo))
line1 = input("")
list1 = line1.split()
numOfObs = eval(list1[0])
numOfRoad = eval(list1[1])

evaluationline = input("")
evaluationlist = evaluationline.split()
connection = []

resultlist = [True]*numOfObs


count = 1
while (count <= numOfRoad):
    road = input("")
    twosides = road.split()
    if eval(evaluationlist[eval(twosides[0]) - 1]) > eval(evaluationlist[eval(twosides[1]) - 1]):
        resultlist[eval(twosides[1]) - 1] = False
    else:
        resultlist[eval(twosides[0]) - 1] = False
    
    count += 1

print(resultlist.count(True))
import numpy as np
n,m=map(int,input().split())
hlist = input().split()
ablist = []
for i in range(m):
    ablist.append(input().split())
x=np.zeros(n,int)
for ab in ablist:
  a=int(ab[0])
  b=int(ab[1])
  if hlist[a-1]<hlist[b-1]:
    x[a-1]=1#ダメ
  elif hlist[a-1]>hlist[b-1]:
    x[b-1]=1#ダメ
  elif hlist[a-1]==hlist[b-1]:
    x[a-1]=1
    x[b-1]=1
count=0
for l in range(n):
  if x[l]==0:
    count+=1
print(count)
N,M=map(int,input().split())
H=list(map(int,input().split()))
A=[]
for i in range(M):
    A.append(list(map(int,input().split())))
    
Q=[0]*N
for i in range(M):
    if H[A[i][0]-1]>=H[A[i][1]-1]:
        Q[A[i][1]-1]=-10**5
    elif H[A[i][0]-1]<=H[A[i][1]-1]:
        Q[A[i][0]-1]=-10**5
n = sum(x>=0 for x in Q)
print(n)
n, m = map(int, input().split())
Hn = list(map(int, input().split()))
abn = [list(map(int, input().split())) for _ in range(m)]
pool = [[h] for h in Hn]
for ab in abn:
    pool[ab[0]-1].append(Hn[ab[1]-1])
    pool[ab[1]-1].append(Hn[ab[0]-1])
ans = 0
for i in range(n):
    if len(pool[i]) == 1:
        ans += 1
    else:
        if max(pool[i]) == pool[i][0] and max(pool[i]) > min(pool[i]):
            ans += 1
print(ans)
#C問題
N,M = map(int, input().split())
H = input().split()
result = [False] * N
H_i = [int(s) for s in H]
bothCount = 0
for i in range(M):
    A,B = map(int, input().split())
    if(H_i[A-1] > H_i[B-1]):
        #AがBよりも高かったらAがいい展望台
        result[A-1] = True
    elif(H_i[A-1] < H_i[B-1]):
        result[B-1] = True
    else:
        result[A-1] = True
Count = 0
Count = result.count(True)
print(Count)
import itertools

N,M = map(int,input().split())
H = list(map(int,input().split()))
AB = [list(map(int,input().split())) for i in range(M)]
# print(AB)
uni = list(itertools.chain.from_iterable(AB))
uni = list(set(uni))
# print(uni)
ans = 0
ans += N-len(uni)
# print(ans)
AB_del = []
for i in range(M):
    hikaku = AB[i]
    if H[hikaku[0]-1] > H[hikaku[1]-1]:
        AB_del.append(hikaku[1]-1)
    else:
        AB_del.append(hikaku[0]-1)


# print(AB_del)
ans = N-len(list(set(AB_del)))-ans
print(ans)
N, M = list(map(int,input().split()))
H = list(map(int,input().split()))
A = [None for _ in range(M)]
B = [None for _ in range(M)]
MAX = []
#リストに入れる時、int型だとsplit()が使えないっぽい
for i in range(M):
  A[i], B[i] = input().split()
for i in range(M):
  A[i] = int(A[i])
  B[i] = int(B[i])
for i in range(M):
  MAX.append(max(H[A[i]-1], H[B[i]-1]))
print(len(list(set(MAX))))
n, m = map(int, input().split())
h = [0] + list(map(int, input().split()))
list1 = [0] + [1] * (n)
for i in range(m):
    a, b = map(int, input().split())
    if h[a] > h[b]:
        list1[a] = 0
    if h[a] < h[b]:
        list1[b] = 0
print(sum(list1))