peterverebics/CodeNet_Python_118 huggingface dataset:
n,k=map(int,input().split())
t=[]
for i in range(k):
    t.append(i+1)
for i in range(k):
    d=int(input())
    nums = [int(e) for e in input().split()]
    for j in range(d):
        if(nums[j] in t):
            t.remove(nums[j])
print(len(t))
n,k = map(int,input().split())
for i in range(k):
        m = set(map(str,input().split()))
s = len(m)    
print(n-s)
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = []
for i in range(k):
  d = input()
  lst = input().split()
  list1 += lst

set1 = set(list1)
nothing = set(i for i in range(n)) - set1
print(len(nothing))
# B
n, k = map(int, input().split())
d = []
a = []
people = [0] * n
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input().split())))
# print(a)
for i in range(k):
    for j in range(d[i]):
        # print(d[i])
        people[j - 1] += 1
ans = 0
# print(people)
for i in people:
    if i == 0:
        ans += 1
print(ans)
[N, K] = list(map(int, input().split()))
dList = []
AList = []
snuckSnack = {}
for i in range(K):
    dList.append(int(input()))
    AList.append(set(map(int, input().split())))
for i in range(1,N+1):
    snuckSnack[i] = set()
for i in dList:
    snuckSnack[i].update(AList[dList.index(i)])
vicCount = 0
for i in range(1,N+1):
    if snuckSnack[i] == set():
        vicCount += 1
print(vicCount)
n,k = map(int,input().split())
s = []
ans = 0
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for i in range(d):
    s.append(A[i])
print(s)
for i in range(n+1):
  if s.count(i) == 0:
    ans += 1
    
print(ans-1)
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)

# first line
N, K = list(map(int, input().rstrip().split()))

ans = []
for i in range(K):
    d = input().rstrip()
    _ = input().rstrip()
    ans.append(d)

print(N - len(set(ans)))
NK = input()
N = int(NK.split()[0]) #すぬけくんの人数
K = int(NK.split()[1]) #お菓子
s = [input() for i in range(K*2)]
m = s[1::2]
z = ''.join(set(m))
l = ''.join(set(z))
w = l.split()
y = [int(a) for a in w]
output = N - len(y)
print(output)
n,m = [int(ch) for ch in input().split()]
heights = [int(ch) for ch in input().split()]
graphs = []
for i in range(n):
    graphs.append([])
for i in range(m):
    roadInfo = [int(ch) for ch in input().split()]
    start = roadInfo[0]-1
    end = roadInfo[1]-1
    graphs[start].append(end)
    graphs[end].append(start)
res = []
for i in range(len(graphs)):
    isGood = True
    for v in graphs[i]:
        if heights[i] <= heights[v]:
            isGood = False
            break
    if isGood:
        res.append(i+1)
print(len(res))
N, M = map(int, input().split())
height = list(map(int, input().split()))
judge = N*[1]
for i in range(M):
	A, B = map(int, input().split())
	if(height[A-1]>=height[B-1]):
		judge[B-1] = 0
	if(height[A-1]<=height[B-1]):
		judge[A-1] = 0

ans = 0
for i in range(N):
	if judge[i]==1:
		ans += 1
print(ans)
n,m=map(int,input().split())
L=list(map(int,input().split()))
K=[0]*n

for i in range(1,m+1):
  a,b=map(int,input().split())
  if L[a-1]>L[b-1]:
    K[b-1]-=1
  if L[a-1]<L[b-1]:
    K[a-1]-=1
  if L[a-1]==L[b-1]:
    K[a-1]-=1
    K[b-1]-=1
    
print(K.count(0))
n,*t=map(int,open(0).read().split())
r=[0]+[1]*n
for a,b in zip(t[n+1::2],t[n+2::2]):r[a]&=t[a]>t[b];r[b]&=t[b]>t[a]
print(sum(r))
import sys
input=sys.stdin.readline

N,M=(int(x) for x in input().rstrip('\n').split())
Hs = [int(x) for x in input().rstrip('\n').split()]
nums = [1 for x in Hs]
for i in range(M):
  roads = [int(x) for x in input().rstrip('\n').split()]
  if Hs[roads[0]-1] < Hs[roads[1]-1]:
    nums[roads[0]-1] = 0
  elif Hs[roads[0]-1] > Hs[roads[1]-1]:
    nums[roads[1]-1] = 0
  else:
    nums[roads[0]-1] = 0
    nums[roads[1]-1] = 0
print(sum(nums))
n, m = map(int, input().split())
h = list(map(int, input().split()))
gon = [1]*n
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1]==h[b-1]:
        gon[a-1], gon[b-1] = 0, 0
    else:
        low = a if h[a-1]<h[b-1] else b
        gon[low-1] = 0
        
print(gon.count(1))
import sys
input = sys.stdin.readline

def ppp(n,m,h,ab):
    g = [1] * n
    for l,r in ab:
        if h[l-1] >= h[r-1]:
            g[r-1] = 0
        if h[l-1] <= h[r-1]:
            g[l-1] = 0
    print(sum(g))
if __name__ == "__main__":
    n,m = map(int,input().split())
    h = list(map(int,input().split()))
    ab = [list(map(int,input().split())) for _ in range(m)]
    ppp(n,m,h,ab)
n,m=map(int,input().split())
H=list(map(int,input().split()))


visited=[1]*n
for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    if H[a]>H[b]:
        visited[b]=0
    elif H[b]>H[a]:
        visited[a]=0
    else:
        visited[a]=visited[b]=0   

print(sum(visited))
n,m=map(int,input().split())
h=list(map(int,input().split()))
flag=[1]*n
for i in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    if h[a] == h[b]:
        flag[a] =0
        flag[b] =0
    elif h[a] > h[b]:
        flag[b] = 0
    else:
        flag[a] = 0
print(sum(flag))
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())
  if H[A-1]>H[B-1]:
    ans[B-1]=0
  elif H[B-1]>H[A-1]:
    ans[A-1]=0
  elif H[A-1]==H[B-1]:
    ans[A-1]=0
    ans[B-1]=0
print(sum(ans))
from collections import defaultdict

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

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

ans = n
for i in range(n):
    for couho in roads[i + 1]:
        if h_s[i] <= h_s[couho - 1]:
            ans -= 1
            break

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(1))
N,M = map(int, input().split())
H = list(map(int, input().split()))
L = []
for i in range(M):
  a, b = map(int, input().split())
  if H[a-1] > H[b-1]:
    L.append(b-1)
  elif H[a-1] < H[b-1]:
    L.append(a-1)
  else:
    L.append(a-1)
    L.append(b-1)
print(N - len(set(L)))
n,m = map(int,input().split())
h=[]
h.extend(input().split())
h=list(map(int,h))
cnt = [0]*n
cnt2 = [0]*n
ans = 0

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

for p in range(n):
  if cnt[p]==cnt2[p]:
    ans += 1
print(ans)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
h_list = list(map(int, input().split()))
ten_list = [1] * n
for i in range(0, m):
    a, b = map(int, input().split())
    if h_list[a - 1] <= h_list[b - 1]:
        ten_list[a - 1] = 0
    if h_list[a - 1] >= h_list[b - 1]:
        ten_list[b - 1] = 0
print(sum(ten_list))
N,M = map(int, input().split())
*H, = map(int, input().split())

V = []
for node in range(N):
    V.append(set())
for _ in range(M):
    a,b = map(int, input().split())
    V[a-1].add(b-1)
    V[b-1].add(a-1)

ans = 0
for node in range(N):
    Hi = H[node]
    flg = 0
    for next_node in V[node]:
        if Hi>H[next_node]:
            continue
        flg = 1
    if flg==0:
        ans = ans + 1
    elif len(V[node])==0:
        ans = ans + 1
print(ans)
n,m = map(int, input().split(' '))
h = list(map(int, input().split(' ')))
a = [list(map(int, input().split(' '))) for _ in range(m)]

res = [set() for _ in range(n)]

for i,j in a:
    res[i-1].add(j-1)
    res[j-1].add(i-1)
ans = 0
res = [j if j != set() else set([i]) for i,j in enumerate(res)]
for i in range(n):
    for j in res[i]:
        if i == j:
            ans += 1
            break
        if h[i] <= h[j]:
            break
    else:
        ans += 1
print(ans)
import numpy as np
n,m = [int(i) for i in input().split()]

h = [int(i) for i in input().split()]

l = [[int(i)-1 for i in input().split()] for _ in range(m)]

ans = np.array([1 for _ in range(n)])

for x,y in l:
    if h[x]>h[y]:
        ans[y] = 0
    elif h[x] < h[y]:
        ans[x] = 0
    else:
        ans[x] = 0
        ans[y] = 0
        
print(np.count_nonzero(ans))
import sys
input = sys.stdin.readline
from heapq import heappush
N, M = map(int, input().split())
H = list(map(int, input().split()))
x = [True] * N
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if H[a] == H[b]:
        x[a] = False
        x[b] = False
    elif H[a] > H[b]:
        x[b] = False
    else:
        x[a] = False
ans = 0
for i in range(N):
    if x[i]:
        ans += 1
print(ans)
N,M = (int(x) for x in input().split()) 
H = list(map(int, input().split()))
A = [0]*M
B = [0]*M
ANS = [0]*N
for i in range(M):
    A[i],B[i] = (int(x) for x in input().split()) 
for i in range(M):
    if(H[A[i]-1] < H[B[i]-1]):
        ANS[A[i]-1] = 1
    elif(H[A[i]-1] > H[B[i]-1]):
        ANS[B[i]-1] = 1
    else:
        ANS[A[i]-1] = 1
        ANS[B[i]-1] = 2
print(ANS.count(0))
n,m = map(int,input().split())
H = [int(i) for i in input().split()]
H_max = [True for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    if H[a-1]>H[b-1]:
        H_max[b-1] = False
    elif H[a-1]<H[b-1]:
        H_max[a-1] = False
    else:
        H_max[a-1] = False
        H_max[b-1] = False
ans = 0
for i in range(n):
    if H_max[i] == True:
        ans += 1
print(ans)
N , M = map(int,input().split())
Height = [h_i for h_i in map(int,input().split())]
Roots = []
counter = [0 for i in range(N)]
for j in range(M):
    root = [c_i -1 for c_i in map(int,input().split())]
    #print(root)
    if Height[root[0]]<Height[root[1]]:
        counter[root[0]] += 1
    elif Height[root[0]]==Height[root[1]]:
        counter[root[0]] += 1
        counter[root[1]] += 1
    else:
        counter[root[1]] += 1

counter2 = 0
for i in range(N):
    if counter[i]==0:
        counter2+=1
print(counter2)
n, h = map(int, input().split())
li = list(map(int, input().split()))
li_a = [[0] for i in range(n)]
for i in range(h):
  a, b = map(int, input().split())
  li_a[a-1].append(li[b-1])
  li_a[b-1].append(li[a-1])
ans = 0
for j in range(n):
  if li[j] > max(li_a[j]):
    ans += 1
print(ans)
n,m = map(int,input().split())
h = list(map(int, input().split()))
ab = [0]* m
box = [1] * n
for i in range(m):
    ab[i] = list(map(int,input().split()))
    if h[ab[i][0]-1] == h[ab[i][1]-1]:
        box[ab[i][0]-1] = 0
        box[ab[i][1] - 1] = 0
    elif h[ab[i][0]-1] > h[ab[i][1]-1]:
        box[ab[i][1] - 1] = 0
    else:
        box[ab[i][0] - 1] = 0
print(sum(box))
N, M = map(int, input().split())
H = [int(h) for h in input().split()]
flag = [1 for i in range(N)]
for i in range(M):
  a, b = map(int, input().split())
  if H[a-1] <= H[b-1]:
    flag[a-1] = 0
  if H[a-1] >= H[b-1]:
    flag[b-1] = 0
print(sum(flag))
N, M = list(map(int, input().split()))
N_i = [1 for i in range(N)]
H = list(map(int, input().split()))


for i in range(M):
    #print("i+1=",i+1)
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        #print('Atakai')
        N_i[B-1] = 0
    elif H[A-1] < H[B-1]:
        #print('B')
        N_i[A-1] = 0
    else:
        N_i[A-1] = 0
        N_i[B-1] = 0



print(N_i.count(1))
#print(N_i)
import sys
sys.setrecursionlimit(10 ** 6)
def input():
	return sys.stdin.readline()[:-1]

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

edge = [[] for i in range(n)]

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

cnt = 0
for i in range(n):
	h = H[i]
	flag = 1
	for nxt in edge[i]:
		# print(nxt)
		# print(H)
		if H[nxt] >= h:
			flag = 0
			break
		elif H[nxt] < h: continue
	if flag: cnt += 1

print(cnt)
n, m = map(int, input().split())

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

good = [1 for j in range(n)] 


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

ans = good.count(1)
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = []
b = []
for i in range(m):
    x = list(map(int, input().split()))
    a.append(x[0])
    b.append(x[1])

ans = [True for i in range(n)]

for x, y in zip(a, b):
    if h[x-1] < h[y-1]:
        ans[x-1] = False
    elif h[x-1] > h[y-1]:
        ans[y-1] = False
    elif h[x-1] == h[y-1]:
        ans[x-1] = False
        ans[y-1] = False

print(ans.count(True))
n, m = map(int, input().split())
h = list(map(int, input().split())) 
a = [list(map(int,input().split())) for i in range(m)]
b = [0] * n
for i in range(m):
 if h[a[i][0]-1] > h[a[i][1]-1]:
   b[a[i][1]-1] +=1
 if h[a[i][0]-1] < h[a[i][1]-1]:
   b[a[i][0]-1] +=1
 if h[a[i][0]-1] == h[a[i][1]-1]: 
   b[a[i][1]-1] +=1
   b[a[i][0]-1] +=1
print(b.count(0))
n, m = map(int, input().split())
hs = list(map(int, input().split()))

peaks = [True] * n

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

print(peaks.count(True))
n,h,*t=[[*map(int,t.split())]for t in open(0)]
p=[1]*n[0]
for a,b in t:x,y=h[a-1],h[b-1];p[-a]&=x>y;p[-b]&=y>x
print(sum(p))
n, m = map(int, input().split())
h = [0] + list(map(int, input().split()))
maxh = [0] * (n + 1)
for i in range(m):
	a, b = map(int, input().split())
	maxh[a] = max(maxh[a], h[b])
	maxh[b] = max(maxh[b], h[a])
	
cnt = 0
for i in range(1, n + 1):
	if h[i] > maxh[i]:
		cnt += 1
print(cnt)
N,M=(int(x) for x in input().split())
T=[1]*N
H=list(map(int,(input().split())))
while 1:
    try:
        A,B=(int(x) for x in input().split())
    except:
        break
    if(H[A-1]<H[B-1]):
        T[A-1]=0
    elif(H[B-1]<H[A-1]):
        T[B-1]=0
    else:
        T[A-1]=0
        T[B-1]=0
print(T.count(1))
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

n,m = LI()
h = LI()
high = [0]*n

for i in range(m):
    a, b = LI()
    if h[a-1]>h[b-1]:
        high[b-1] += 1
    elif h[a-1]==h[b-1]:
        high[a-1] += 1
        high[b-1] += 1
    else:
        high[a-1] += 1
print(high.count(0))
N , M =map(int , input().split())
S = set(k for k in range(0,N))
H = list(map(int , input().split()))
for i in range(M):
    f , g =map(int , input().split())
    x=f-1
    y=g-1
    if H[x]<=H[y]:
            S.discard(x)
    if H[x]>=H[y]:
            S.discard(y)
print(len(S))
N,M=map(int,input().split())
H=list(map(int,input().split()))
AB=[]
for i in range(M):
    AB.append(list(map(int,input().split())))

J=[0]*N
for i in range(M):
    if H[AB[i][0]-1]<H[AB[i][1]-1]:
        J[AB[i][0]-1]+=1
    elif H[AB[i][0]-1]==H[AB[i][1]-1]:
        J[AB[i][0]-1]+=1
        J[AB[i][1]-1]+=1    
    else:
        J[AB[i][1]-1]+=1
c=0
for i in J:
    if i == 0:
        c+=1

print(c)
N, M = map(int, input().split())
Hs = input().split()
lis = []
for i in range(N):
  lis.append([])
for m in range(M):
  A, B = map(int, input().split())
  lis[A-1].append(B-1)
  lis[B-1].append(A-1)

score = 0

for i in range(N):
  break_flag = 0
  base_h = int(Hs[i])
  #print('base',base_h)
  hikaku = lis[i]
  #print('hikaku', hikaku)
  for j in range(len(hikaku)):
    #print('hikaku', hikaku[j])
    if int(Hs[hikaku[j]]) >= base_h:
      break_flag = 1
  if break_flag != 1:
    score += 1
print(score)
n,m = map(int,input().split())
h = [int(x) for x in input().split()]

mem = [[] for _ in range(n)]

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

ans = 0



for j in range(n):
    flag = 1
    for k in range(len(mem[j])):
        if h[j] <= h[mem[j][k]]:
            flag = 0
    if flag ==  1:
        ans += 1

print(ans)
a=input().split()
N=int(a[0])
M=int(a[1])
H=[int(x) for x in input().split()]
way=[]
for i in range(M):
    way.append([int(x) for x in input().split()])

dic={}
for i in range(N):
    dic[i]=set()

for h in way:
    dic[h[0]-1].add(h[1]-1)
    dic[h[1]-1].add(h[0]-1)
    

print(sum(all([H[i]>H[hs] for hs in dic[i]])for i in range(N)))
n,m=map(int,input().split())
h=list(map(int,input().split()))
t=[]
for i in range(m):
    t.append(list(map(int,input().split())))
ans=[True]*n
for i in range(m):
    a,b=t[i]
    if(h[a-1]<=h[b-1]):
        ans[a-1]=False
    if(h[b-1]<=h[a-1]):
        ans[b-1]=False
print(ans.count(True))
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())
    if h[a-1]>h[b-1]:
        ans[b-1] = 0
    elif h[b-1]>h[a-1]:
        ans[a-1] = 0
    else:
        #print("a")
        ans[a-1] = 0
        ans[b-1] = 0
print(ans.count(1))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
arr = [[] for i in range(N)]
ans = 0
#print(arr)
for i in range(M):
    a, b = list(map(int, input().split()))
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)

for i in range(N):
    if arr[i] == []:
        ans += 1
    else:
        if all(H[i] > H[arr[i][j]] for j in range(len(arr[i]))):
            ans += 1

print(ans)
from collections import defaultdict
N,K=map(int,input().split())
L=list(map(int,input().split()))
Hash=defaultdict(lambda:list())
for i in range(K):
    x,y=map(int,input().split())
    Hash[x-1].append(y-1)
    Hash[y-1].append(x-1)
count=0
for i in range(N):
    FLAG=0
    for k in Hash[i]:
        if L[k]>=L[i]:
            FLAG=1
            break
    if FLAG==0:
        count+=1
print(count)
N, M = list(map(int, input().split()))
height_list = list(map(int, input().split()))
tenbo_list = []

count = 0

for n in range(N):
    tenbo_list.append([])

for n in range(M):
    A, B = list(map(int, input().split()))
    tenbo_list[A-1].append(B-1)
    tenbo_list[B-1].append(A-1)

ite = 0
for t in tenbo_list:
    count += 1
    for a in t:
        if height_list[a] >= height_list[ite]:
            count -= 1
            break
    ite += 1

print(count)
N, r = map(int, input().split())
hs = list(map(int, input().split()))
g = [1]*N
for i in range(r):
    road = list(map(int, input().split()))
    if hs[road[0] - 1] >= hs[road[1] - 1]:
        g[road[1] - 1] = 0
    if hs[road[0] - 1] <= hs[road[1] - 1]:
        g[road[0] - 1] = 0
print(sum(g))
n,m = map(int, input().split())
h = list(map(int, input().split()))
path = [list(map(int, input().split())) for i in range(m)]

ans = [[i] for i in h]

for i in path:
    ans[i[0]-1].append(h[i[1]-1])
    ans[i[1]-1].append(h[i[0]-1])


count = 0
for i in ans:
    if len(i)==1:
      count += 1
    elif i[0] == max(i) and i.count(i[0])==1:
      count +=1
print(count)
N, M = map(int, input().split())
H = list(map(int, input().split()))
g = [[] for i in range(N)]
for i in range(M):
  a, b = map(int, input().split())
  g[a-1].append(b-1); g[b-1].append(a-1)

ans = 0
for i in range(N):
  neighbors = g[i]
  h = H[i]
  res = True
  for node in neighbors:
    res *= h > H[node]
  ans += res

print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
ac=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1] and ac[a-1] != 0:
    ac[a-1]=1
    ac[b-1]=0
  elif h[a-1]<h[b-1] and ac[b-1] != 0:
    ac[a-1]=0
    ac[b-1]=1
  else:
    ac[b-1]=0
    ac[a-1]=0

print(ac.count(1))
N, M = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]

good = [True]*N

for i in range(M):
    a, b = [int(i)-1 for i in input().split()]
    if H[a] >= H[b]:
        good[b] = False
    if H[b] >= H[a]:
        good[a] = False

print(sum(good))
N,M = list(map(int, input().split()))
Hs = list(map(int, input().split()))

is_good = [True] * N

for i in range(M):
    a,b = list(map(int, input().split()))

    if Hs[a-1] == Hs[b-1]:
        is_good[a-1] = False
        is_good[b-1] = False
    elif Hs[a-1] < Hs[b-1]:
        is_good[a-1] = False
    else:
        is_good[b-1] = False

cnt = 0 
for v in is_good:
    if v:
        cnt += 1

print(cnt)
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]

d = {num for num in range(1, n + 1)}
for i in range(m):
    if h[ab[i][0] - 1] > h[ab[i][1] - 1]:
        d.discard(ab[i][1])
    elif h[ab[i][0] - 1] < h[ab[i][1] - 1]:
        d.discard(ab[i][0])
    elif h[ab[i][0] - 1] == h[ab[i][1] - 1]:
        d.discard(ab[i][1])
        d.discard(ab[i][0])

print(len(d))
n,m = map(int, input().split())
H = list(map(int, input().split()))
d = {i:[] for i in range(1, n+1)}

for _ in range(m):
  a,b = map(int, input().split())
  d[a].append(b)
  d[b].append(a)
  
count = 0  
  
for k,v in d.items():
  if not v:
    count += 1
  else:
    flg = True
    for v_i in v:
      if H[k-1]<=H[v_i-1]:
        flg = False
        break
    if flg:
      count += 1
    
print(count)
N, M = map(int, input().split())
H = list(map(int, input().split()))

A = [0]*M
B = [0]*M
for i in range(M):
    ta, tb = map(int, input().split())
    A[i] = ta - 1
    B[i] = tb - 1

ans = [True]*N
# v: Trueならいい展望台、Falseなら良くない展望台 
for i in range(M):
    ans[A[i]] = H[A[i]] > H[B[i]] and ans[A[i]]
    ans[B[i]] = H[B[i]] > H[A[i]] and ans[B[i]]

print(ans.count(True))
n,m = map(int,input().split())
l=list(map(int,input().split()))
r=[True]*(n+1)
r[0]=False
d={}
for i in range(m):
    a,b=map(int,input().split())
    if l[a-1]>l[b-1]:
        r[b]=False
    if l[a-1]<l[b-1]:
        r[a]=False
    if l[a-1]==l[b-1]:
        r[a]=False
        r[b]=False
cnt=0
for i in r:
    if i:
        cnt+=1

print(cnt)
N,M = map(int,input().split())
H = list(map(int,input().split()))
c = [0] * N
for i in range(M):
    A,B = map(int,input().split())
    if H[A -1] >= H[B -1]:
        c[B - 1] += 1
    if H[B - 1] >= H[A - 1]:
        c[A - 1] += 1
print(c.count(0))
N, M = map(int, input().split())
Hs = list(map(int, input().split()))
ans = [1 for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    if Hs[A-1] > Hs[B-1]:
        ans[B-1] = 0
    elif Hs[A-1] == Hs[B-1]:
        ans[A-1] = 0
        ans[B-1] = 0
    else:
        ans[A-1] = 0
print(sum(ans))
import sys
input = sys.stdin.readline
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list(int(x) for x in input().split())

flag = [1]*N

for i in range(M):
    A,B = map(int, input().split())
    A -= 1
    B -= 1
    if(Hlist[A] == Hlist[B]) :
        flag[A] = 0
        flag[B] = 0
    elif(Hlist[A] > Hlist[B]) :
        flag[B] = 0
    else:
        flag[A] = 0
print(sum(flag))
n,m = map(int,input().split())
h = list(map(int,input().split()))
g = [0]*n
co = 0
for _ in range(m):
    a,b = map(int,input().split())
    g[a-1] = -1 if h[a-1]<=h[b-1] or g[a-1]==-1 else 1
    g[b-1] = -1 if h[b-1]<=h[a-1] or g[b-1]==-1 else 1


for i in range(n):
    if g[i] < 0:
        continue
    co+=1

print(co)
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
    elif h[a-1] > h[b-1]:
        ans[b-1] += 1
    else:
        ans[a-1] += 1
        ans[b-1] += 1

print(ans.count(0))
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]:
    if H[A-1]!=0:
      ans[B-1]=0
  elif H[A-1]<H[B-1]:
    if H[B-1]!=0:
      ans[A-1]=0
  else:
    ans[A-1]=0
    ans[B-1]=0
print(ans.count(1))
n,k=map(int,input().split())
l=[True]*n
h=list(map(int,input().split()))
for i in range(k):
    a,b=map(int,input().split())
    a-=1
    b-=1
    if l[a] and h[a]<=h[b]:
        l[a]=False
    if l[b] and h[a]>=h[b]:
        l[b]=False
count=0
for i in range(n):
    if l[i]:
        count+=1
print(count)
n,m=map(int,input().split())
H=list(map(int,input().split()))
L=[[h,[]] for h in H]
for i in range(m):
    a,b=map(int,input().split())
    L[a-1][1].append(b-1)
    L[b-1][1].append(a-1)
c=0
for l in L:
    h=l[0]
    if all([h>L[i][0] for i in l[1]]):c+=1
print(c)
n, m =map(int, input().split())
H=list(map(int, input().split()))
cnt=[0]*n

for i in range(m):
	a, b = map(int, input().split())
	if H[a-1]>H[b-1]:
		cnt[b-1]+=1
	elif H[b-1]>H[a-1]:
		cnt[a-1]+=1
	else:
		cnt[a-1]+=1
		cnt[b-1]+=1

print(cnt.count(0))