There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.
There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.
Obs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.
Note that Obs. i is also good when no observatory can be reached from Obs. i using just one road.
How many good observatories are there?

-----Constraints-----
 - 2 \leq N \leq 10^5
 - 1 \leq M \leq 10^5
 - 1 \leq H_i \leq 10^9
 - 1 \leq A_i,B_i \leq N
 - A_i \neq B_i
 - Multiple roads may connect the same pair of observatories.
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N M
H_1 H_2 ... H_N
A_1 B_1
A_2 B_2
:
A_M B_M

-----Output-----
Print the number of good observatories.

-----Sample Input-----
4 3
1 2 3 4
1 3
2 3
2 4

-----Sample Output-----
2

 - From Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.
 - From Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.
 - From Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.
 - From Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.
Thus, the good observatories are Obs. 3 and 4, so there are two good observatories.
[{"code": "N,M = map(int,input().split())\nhigh = list(map(int,input().split()))\nans = [0]*N\ncnt = 0\nfor i in range(M):\n    a,b = map(int,input().split())\n    ans[a-1] = max(high[b-1],ans[a-1])\n    ans[b-1] = max(ans[b-1],high[a-1])\n\nfor j in range(N):\n    if ans[j] < high[j]:\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14032.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = [int(a) for a in input().split()]\nX = [1] * N\nfor _ in range(M):\n    a, b = list(map(int, input().split()))\n    a, b = a-1, b-1\n    if H[a] <= H[b]:\n        X[a] = 0\n    if H[b] <= H[a]:\n        X[b] = 0\nprint((sum(X)))\n", "passed": true, "time": 1.04, "memory": 14232.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nc=0\nd=[0]*n\nfor i in range(m):\n    a,b=map(int,input().split())\n    d[a-1]=max(d[a-1],h[b-1])\n    d[b-1]=max(d[b-1],h[a-1])\nfor i in range(n):\n    if h[i]>d[i]:\n        c+=1\nprint(c)", "passed": true, "time": 0.16, "memory": 14168.0, "status": "done"}, {"code": "from collections import deque\nn,m = map(int,input().split())\nh=list(map(int,input().split()))\ng = [[] for _ in range(n)]\nfor _ in range(m):\n    a,b = map(int,input().split())\n    a-=1\n    b-=1\n    g[a].append(b)\n    g[b].append(a)\nans=0\nfor j in range(n):\n    for i in g[j]:\n        if h[j]<=h[i]:\n            break\n    else:\n        ans+=1\nprint(ans)", "passed": true, "time": 0.18, "memory": 14324.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nheights = list(map(int, input().split()))\n\nneighbors = [[] for i in range(n)]\n\nfor i in range(m):\n    a, b = list(map(int, input().split()))\n    neighbors[a - 1].append(b - 1)\n    neighbors[b - 1].append(a - 1)\n\ncount = 0\nfor i in range(n):\n    hanamaru = True\n    for j in neighbors[i]:\n        if heights[i] > heights[j]:\n            continue\n        else:\n            hanamaru = False\n            break\n    if hanamaru is True:\n        count += 1\n\nprint(count)\n", "passed": true, "time": 1.71, "memory": 14108.0, "status": "done"}, {"code": "n, m = [int(i) for  i in input().split()]\nh = [int(i) for i in input().split()]\nedges = [[] for i in range(n)]\nfor _ in range(m):\n  edge = [int(i)-1 for i in input().split()]\n  edges[edge[0]].append(edge[1])\n  edges[edge[1]].append(edge[0])\ncnt = 0\n\nfor i in range(n):\n  flg = True\n  for j in edges[i]:\n    if h[i] <= h[j]:\n      flg = False\n      break\n  if flg:\n    cnt += 1\nprint(cnt)", "passed": true, "time": 0.28, "memory": 14300.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\n\ngood = [1] * N\nfor i in range(M):\n    A, B = list(map(int, input().split()))\n    A, B = A - 1, B - 1\n    HA = H[A]\n    HB = H[B]\n    if HA == HB:\n        if good[A]:\n            good[A] = 0\n        if good[B]:\n            good[B] = 0\n    elif HA < HB and good[A]:\n        good[A] = 0\n    elif HB < HA and good[B]:\n        good[B] = 0\n\nprint((sum(good)))\nreturn\n", "passed": true, "time": 0.19, "memory": 14356.0, "status": "done"}, {"code": "N,M=list(map(int,input().split()))\nH=list(map(int,input().split()))\ncnt=[1 for _ in range(N)]\nfor _ in range(M):\n    A,B=list(map(int,input().split()))\n    A-=1\n    B-=1\n    if H[A]>H[B]:\n        cnt[B]=0\n    elif H[A]<H[B]:\n        cnt[A]=0\n    else:\n        cnt[A]=0\n        cnt[B]=0\nprint((cnt.count(1)))\n", "passed": true, "time": 1.29, "memory": 14208.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nHlist=list(map(int,input().split()))\nABlist=[]\nfor _ in range(M):\n    ABlist.append(list(map(int,input().split())))\nflaglist=[1]*N\nfor row in ABlist:\n    one=row[0]-1 #index\u3068\u756a\u53f7\u306e\u8abf\u6574\n    two=row[1]-1\n    if Hlist[one]<=Hlist[two]:\n        flaglist[one]=0\n    if Hlist[one]>=Hlist[two]:\n        flaglist[two]=0\nprint(sum(flaglist))", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "N, M = map(int,input().split())\nH = list(map(int,input().split()))\nA, B = [], []\nfor _ in range(M):\n  a, b = map(int,input().split())\n  A.append(a)\n  B.append(b)\n\nL = [1] * N\n\nfor i in range(M):\n  ai = A[i] - 1\n  bi = B[i] - 1\n  if H[ai] > H[bi]:\n    L[bi] = 0\n  elif H[bi] > H[ai]:\n    L[ai] = 0\n  else:\n    L[ai], L[bi] = 0, 0\n\nprint(L.count(1))", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "n, m = list(map(int,input().split()))\n\nh = list(map(int,input().split()))\n\ncnt = [0] * n\n\nfor i in range(m):\n    a,b = list(map(int,input().split()))\n    cnt[a-1] = max(cnt[a-1], h[b-1])\n    cnt[b-1] = max(cnt[b-1], h[a-1])\n\n\n    \nres = sum([h[i] > cnt[i] for i in range(n)])\n\n\nprint(res)\n", "passed": true, "time": 0.18, "memory": 14308.0, "status": "done"}, {"code": "N,M = list(map(int, input().split()))\n\nH=list(map(int,input().split()))\n\ngraph=[[0] for _ in range(N)]\n\nfor i in range(M):\n    A, B = list(map(int, input().split()))\n    graph[A-1].append(H[B-1])\n    graph[B-1].append(H[A-1])\n\nans=0\n\nfor i in range(N):\n    if H[i]>max(graph[i]):\n        ans+=1\n        \nprint(ans)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n\n                \n            \n\n\n\n\n\n    \n\n\n\n\n\n\n\n\n\n        \n\n    \n\n\n\n\n\n\n\n\n\n    \n\n        \n\n\n\n\n    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n\n\n\n    \n\n\n\n\n\n    \n\n\n\n\n\n\n        \n\n\n\n\n\n\n    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n            \n    \n\n\n    \n\n\n    \n    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n\n\n    \n\n\n\n\n\n\n\n\n\n\n\n\n", "passed": true, "time": 0.17, "memory": 14276.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\n\ng = [[] for _ in range(n)]\nfor _ in range(m):\n  a,b = map(int,input().split())\n  g[a-1].append(b-1)\n  g[b-1].append(a-1)\n\ncnt = n\nfor i in range(n):\n  for j in g[i]:\n    if h[i] <= h[j]:\n      cnt -= 1\n      break\nprint(cnt)", "passed": true, "time": 0.17, "memory": 14292.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nheight_list = list(map(int, input().split()))\nroad_list_1 = [list(map(int, input().split())) for i in range(M)]\nroad_list = [[road_list_1[j][i] - 1 for i in range(2)] for j in range(M)]\nobservation_deck = list(range(N))\n\nfor i in range(M):\n    if height_list[road_list[i][0]] >= height_list[road_list[i][1]]:\n        observation_deck[road_list[i][1]] = -1\n    if height_list[road_list[i][0]] <= height_list[road_list[i][1]]:\n        observation_deck[road_list[i][0]] = -1\n\nanswer = 0\n\nfor i in range(N):\n    if observation_deck[i] != -1:\n        answer += 1\n\nprint(answer)", "passed": true, "time": 0.19, "memory": 14260.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nH=list(map(int,input().split()))\nA=[0]*M;B=[0]*M\nC=[0]*N\nfor i in range(M):\n  A[i],B[i]=map(int,input().split())\n\nfor i in range(M):\n  if H[A[i]-1]<H[B[i]-1]:C[A[i]-1]+=1\n  elif H[A[i]-1]>H[B[i]-1]:C[B[i]-1]+=1\n  else:C[A[i]-1]+=1;C[B[i]-1]+=1\nprint(C.count(0))", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "\nn, m = list(map(int, input().split()))\nl = list(map(int, input().split()))\ncor = [[] for i in range(n)]\n\nfor i in range(m):\n    a, b = list(map(int, input().split()))\n    a -= 1\n    b -= 1\n    cor[a].append(b)\n    cor[b].append(a)\n\nans = 0\nfor i in range(n):\n    max_h = l[i]\n    cnt = 1\n    co = list(set(cor[i]))\n    for j in range(len(co)):\n        if l[co[j]] >= max_h:\n            cnt = 0\n            break\n    ans += cnt\n\nprint(ans)\n\n\n\n", "passed": true, "time": 0.19, "memory": 14348.0, "status": "done"}, {"code": "n,m=map(int, input().split())\nh=list(map(int, input().split()))\nnear=[[0] for i in h]\nfor i in range(m):\n    a,b=map(int, input().split())\n    near[a-1].append(h[b-1])\n    near[b-1].append(h[a-1])\ncnt=0\nfor i in range(n):\n    if max(near[i])<h[i]:\n        cnt+=1\nprint(cnt)", "passed": true, "time": 0.15, "memory": 14340.0, "status": "done"}, {"code": "def main() -> None:\n    n, m = list(map(int, input().split()))\n    heights = tuple(map(int, input().split()))\n\n    good = [1] * n\n    for _ in range(m):\n        a, b = list(map(int, input().split()))\n        height_a, height_b = heights[a-1], heights[b-1]\n        if height_a == height_b:\n            good[a-1], good[b-1] = 0, 0\n        elif height_a < height_b:\n            good[a-1] = 0\n        else:\n            good[b-1] = 0\n    print((good.count(1)))\n    return\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.19, "memory": 14252.0, "status": "done"}, {"code": "N,M=map(int,input().split())\nH=list(map(int,input().split()))\nroad=[[] for i in range(N)]\nfor i in range(M):\n    a,b=map(int,input().split())\n    road[a-1].append(b)\n    road[b-1].append(a)\nc=0\nfor i in range(N):\n    T=True\n    for j in road[i]:\n        if H[i]<=H[j-1]:\n            T=False\n    if T:\n        c+=1\nprint(c)", "passed": true, "time": 0.14, "memory": 14132.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef main():\n    n , m = map( int , input().split() )\n    h = list( map( int , input().split() ) )\n    goods = [ 1 for i in range(n) ]\n    for i in range( m ):\n        a , b = map( lambda x : int(x) - 1  , input().split() )\n        if ( h[a] > h[b] ):\n            goods[ b ] = 0\n        if ( h[a] < h[b] ):\n            goods[ a ] = 0\n        if ( h[a] == h[b] ):\n            goods[ a ] = 0\n            goods[ b ] = 0\n    print( sum(goods) )\nmain()", "passed": true, "time": 0.14, "memory": 14360.0, "status": "done"}, {"code": "n, m = map(int,input().split())\nh = list(map(int,input().split()))\nl = [1]*n\nfor i in range(m):\n  a, b = map(int,input().split())\n  if h[a-1] == h[b-1]:\n    l[a-1] = 0\n    l[b-1] = 0\n  if h[a-1] > h[b-1]:\n    l[b-1] = 0\n  if h[a-1] < h[b-1]:\n    l[a-1] = 0\nprint(l.count(1))", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\n\ngood = [1] * N\nfor i in range(M):\n    A, B = list(map(int, input().split()))\n    HA = H[A - 1]\n    HB = H[B - 1]\n    if HA == HB:\n        if good[A - 1]:\n            good[A - 1] = 0\n        if good[B - 1]:\n            good[B - 1] = 0\n    elif HA < HB and good[A - 1]:\n        good[A - 1] = 0\n    elif HB < HA and good[B - 1]:\n        good[B - 1] = 0\n\nprint((sum(good)))\nreturn\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nHlist = list(map(int,input().split()))\n\nanslist = [1]*N\nfor i in range(M):\n  A,B = map(int,input().split())\n  #print (Hlist[A-1])\n  #print (Hlist[B-1])\n  if Hlist[A-1]<Hlist[B-1]:\n    anslist[A-1]=0\n  elif Hlist[A-1]>Hlist[B-1]:\n    anslist[B-1]=0\n  elif Hlist[A-1]==Hlist[B-1]:\n    anslist[A-1]=0\n    anslist[B-1]=0\n    \n#print (anslist)\nprint (sum(anslist))", "passed": true, "time": 0.21, "memory": 14224.0, "status": "done"}, {"code": "import sys\npin=sys.stdin.readline\n\ndef main():\n  N,M=map(int,pin().split())\n  H=list(map(int,pin().split()))\n  d=[True]*N\n  ans=0\n  for _ in [0]*M:\n    A,B=map(int,pin().split())\n    if H[A-1]>H[B-1]:\n      d[B-1]=False\n    elif H[B-1]>H[A-1]:\n      d[A-1]=False\n    else:\n      d[A-1]=False\n      d[B-1]=False\n  for i in d:\n    if i:\n      ans+=1\n  print(ans)\n  return\nmain()", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "import sys\nn,m=map(int,sys.stdin.readline().split())\n\ndata={}\nh=[int(i) for i in sys.stdin.readline().split()]\nfor i in range(1,n+1):\n    data[i]=set()\n\nfor i in range(1,m+1):\n    a,b=map(int,sys.stdin.readline().split())\n    data[a].add(b)\n    data[b].add(a)\n\n\nans=0\nfor i in data:\n    if len(data[i])==0:\n        ans+=1\n    elif all(h[i-1]>h[j-1] for j in data[i]):\n        ans+=1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n, m = map(int,input().split())\nH = list(map(int,input().split()))\nAB = []\nans = 0\nfor i in range(m):\n    AB.append(list(map(int,input().split())))\n    AB[-1][0] -= 1\n    AB[-1][1] -= 1\nok = [1]*n\nfor i in range(m):\n    if H[AB[i][0]] >= H[AB[i][1]]:\n        ok[AB[i][1]] = 0\n    if H[AB[i][0]] <= H[AB[i][1]]:\n        ok[AB[i][0]] = 0\nfor i in ok:\n    if i:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nlist_h = list(map(int, input().split()))\ntable = [1] * N\n\nfor i in range(M):\n  A, B = list(map(int, input().split()))\n  if list_h[B-1] < list_h[A-1]:\n    table[B-1] = 0\n  elif list_h[A-1] < list_h[B-1]:\n    table[A-1] = 0\n  else:\n    table[A-1] = 0\n    table[B-1] = 0\n\nprint(str(sum(table)))", "passed": true, "time": 0.15, "memory": 14180.0, "status": "done"}, {"code": "N,M = map(int,input().split())\narray = list(map(int,input().split()))\nans = [1]*N\nfor i in range (M):\n  A,B = map(int,input().split())\n  if array[A - 1] < array[B - 1]:\n    ans[A - 1] = 0\n  elif array[A - 1] > array[B - 1]:\n    ans[B - 1] = 0\n  else:\n    ans[A-1],ans[B-1] = 0,0\nprint( sum(ans) )", "passed": true, "time": 0.3, "memory": 14320.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nH=list(map(int,input().split()))\nans = [1]*n\nfor i in range(m):\n  a,b=list(map(int,input().split()))\n  if H[a-1]>=H[b-1]:\n    ans[b-1] = 0\n  if H[a-1]<=H[b-1]:\n    ans[a-1] = 0\nprint((sum(ans)))\n", "passed": true, "time": 0.15, "memory": 14144.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nH = list(map(int,input().split()))\nL = [1]*n\nfor _ in range(m):\n  a,b = map(int,input().split())\n  a -= 1\n  b -= 1\n  if H[a] == H[b]:\n    L[a] = 0\n    L[b] = 0\n  elif H[a] < H[b]:\n    L[a] = 0\n  elif H[a] > H[b]:\n    L[b] = 0\nprint(sum(L))", "passed": true, "time": 0.16, "memory": 14200.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\n\nh = list(map(int, input().split()))\nall_dict = {}\nfor m in range(M):\n    a, b = list(map(int, input().split()))\n    \n    a -= 1\n    b -= 1\n    \n    all_dict.setdefault(a, [])\n    all_dict.setdefault(b, [])\n\n    all_dict[a].append(b)\n    all_dict[b].append(a)\n\ntotal_good = 0\n\nfor i in range(N):\n    is_good = 1\n    all_dict.setdefault(i, [])\n    for around_h in all_dict[i]:\n        if h[around_h] >= h[i]:\n            is_good = 0\n    total_good += is_good\n\nprint(total_good)\n\n\n", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "N,M = map(int, input().split())\n\nH=list(map(int,input().split()))\n\ngraph=[[0] for _ in range(N)]\n\nfor i in range(M):\n    A, B = map(int, input().split())\n    graph[A-1].append(H[B-1])\n    graph[B-1].append(H[A-1])\n\nans=0\n\nfor i in range(N):\n    if H[i]>max(graph[i]):\n        ans+=1\n        \nprint(ans)", "passed": true, "time": 0.15, "memory": 14308.0, "status": "done"}, {"code": "def main():\n    import collections\n    n, m = list(map(int, input().split()))\n    hs = list(map(int, input().split()))\n    nmap = [0] * n\n    cnt = 0\n\n    for j in range(m):\n        v = input().split()\n        v0 = int(v[0]) - 1\n        v1 = int(v[1]) - 1\n        if hs[v0] < hs[v1]:\n            nmap[v0] += 1\n        elif hs[v0] == hs[v1]:\n            nmap[v0] += 1\n            nmap[v1] += 1\n        else:\n            nmap[v1] += 1\n    for i in nmap:\n        if i == 0:\n            cnt += 1\n    return cnt\n\n\ndef __starting_point():\n    print((main()))\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "import copy\nN,M=list(map(int, input().split()))\nnum_list = list(map(int, input().split()))\nlist1=copy.copy(num_list)\nfor i in range(M):\n    A,B=list(map(int, input().split()))\n    if num_list[A-1]<num_list[B-1]:\n        list1[A-1]=0\n    elif num_list[A-1]>num_list[B-1]:\n        list1[B-1]=0\n    else:\n        list1[A-1]=0\n        list1[B-1]=0\n\ns=0\nfor j in list1:\n    if j>0:\n        s=s+1\n\nprint(s)\n", "passed": true, "time": 0.16, "memory": 14160.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = [int(s) for s in input().split()]\nab = []\n\nfor i in range(m):\n    ab.append([int(s) for s in input().split()])\n\nh2 = []\nfor p in ab:\n    if h[p[0] - 1] <= h[p[1] - 1]:\n        h2.append(p[0] - 1)\n    if h[p[0] - 1] >= h[p[1] - 1]:\n        h2.append(p[1] - 1)\n\nprint((len(h) - len(list(set(h2)))))\n", "passed": true, "time": 0.27, "memory": 14244.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\n\nmiti = []\nfor i in range(M):\n    miti.append(list(map(int,input().split())))\n\ncount = []\nfor i in range(N):\n    count.append(1)\n\nfor i in range(M):\n    if H[miti[i][0]-1] < H[miti[i][1]-1]:\n        count[miti[i][0]-1]=0\n\n    if H[miti[i][0]-1] > H[miti[i][1]-1]:\n        count[miti[i][1]-1]=0\n\n    if H[miti[i][0]-1] == H[miti[i][1]-1]:\n        count[miti[i][0]-1]=0\n        count[miti[i][1]-1]=0\n\nans = 0\nfor i in range(N):\n    ans += count[i]\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = [0]+list(map(int,input().split()))\n\nroute = [[0] for _ in range(n+1)]\nfor _ in range(m):\n    a,b = list(map(int,input().split()))\n    route[a].append(h[b])\n    route[b].append(h[a])\n\ncnt=0\nfor i in range(1,n+1):\n    if h[i]>max(route[i]):\n        cnt+=1\nprint(cnt)\n", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nH.insert(0, 0)\nt = [True] * (N+1)\n\nfor i in range(M):\n    a, b = map(int, input().split())\n    if H[a] <= H[b]:\n        t[a] = False\n    if H[b] <= H[a]:\n        t[b] = False\n\nc = 0\nfor i in range(1, N+1, 1):\n    if t[i]:\n        c += 1\n\nprint(c)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n, m = map(int, input().split())\n\nh = list(map(int, input().split()))\n\nans = [0] * n\n\nfor i in range(m):\n    a, b = map(int, input().split())\n    ans[a - 1] = max(ans[a - 1], h[b - 1])\n    ans[b - 1] = max(ans[b - 1], h[a - 1])\n\nanser = 0\n\nfor i in range(n):\n    if ans[i] < h[i]:\n        anser += 1\n\nprint(anser)", "passed": true, "time": 0.15, "memory": 14164.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\nadj_max = [0]*N\nans = 0\nfor _ in range(M):\n  tmp1, tmp2 = list(map(int, input().split()))\n  adj_max[tmp1-1] = max(adj_max[tmp1-1], H[tmp2-1])\n  adj_max[tmp2-1] = max(adj_max[tmp2-1], H[tmp1-1])\nfor num in range(N):\n  if H[num] > adj_max[num]:\n    ans += 1\nprint(ans)\n\n", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "#ABC166\nN,M=map(int,input().split())\nH =list(map(int,input().split()))  #\u5c55\u671b\u53f0\u306e\u6a19\u9ad8\nA = list(range(1,N+1))\nfor i in range(M):\n    a, b = map(int, input().split())\n    if H[a-1] > H[b-1]:\n        A[b-1] = 0\n    elif H[a-1] < H[b-1]:\n        A[a-1] = 0\n    else:\n        A[a-1] = 0\n        A[b-1] = 0\nprint(N-A.count(0))", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = list(map(int,input().split()))\nab = [list(map(int,input().split())) for _ in range(m)]\n\ngood = [True]*n\n\nfor i in range(m):\n    if h[ab[i][0]-1] < h[ab[i][1]-1]:\n        good[ab[i][0]-1] = False\n    elif h[ab[i][0]-1] > h[ab[i][1]-1]:\n        good[ab[i][1]-1] = False\n    else:\n        good[ab[i][0]-1] = False\n        good[ab[i][1]-1] = False\n\n#print(good)\nprint((good.count(True)))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\n# N,M=O(10^5)\u306a\u306e\u3067\u3001O(N+M)\u3067\u89e3\u304f\n# \u5404\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u96a3\u63a5\u3059\u308b\u5c55\u671b\u53f0\u306e\u9ad8\u3055\u306e\u6700\u5927\u5024\u3092\u66f4\u65b0\u3059\u308b\nneighbor_max = [0] * N\nfor _ in range(M):\n  A, B = map(int, input().split())\n  neighbor_max[A - 1] = max(neighbor_max[A - 1], H[B - 1])\n  neighbor_max[B - 1] = max(neighbor_max[B - 1], H[A - 1])\n\n# \u5404\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u81ea\u8eab\u306e\u9ad8\u3055\u3068\u3001\u96a3\u63a5\u3059\u308b\u5c55\u671b\u53f0\u306e\u9ad8\u3055\u306e\u6700\u5927\u5024\u3092\u6bd4\u8f03\u3059\u308b\n# \u63a5\u7d9a\u3092\u4e00\u3064\u3082\u6301\u305f\u306a\u3044\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3082\u3001\u8a08\u7b97\u306f\u6b63\u3057\u3044\nans = 0\nfor i in range(N):\n  if H[i] > neighbor_max[i]: ans += 1\n    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nheight = [0] + list(map(int, input().split()))\nmawari = [0] * (n+1) \nans = 0\n\nfor _ in range(m):\n    a, b = map(int, input().split())\n    mawari[a] = max(mawari[a], height[b])\n    mawari[b] = max(mawari[b], height[a])\n    \n\nfor i in range(1,n+1):\n    if height[i]> mawari[i]:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "def i_input(): return int(input())\n\n\ndef i_map(): return list(map(int, input().split()))\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\n\nn,m= i_map()\nhh=i_list()\nab=i_row_list(m)\nt=[1]*n\nfor a,b in ab:\n    if hh[a-1]<=hh[b-1]:\n        t[a-1]=0\n    if hh[b-1]<=hh[a-1]:\n        t[b-1]=0\nprint((sum(t)))\n\n", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "\ndef main():\n    n, m = map(int, input().split(\" \"))\n    ls=[{} for _ in range(n)]\n    h = list(map(int, input().split(\" \")))\n    for i in range(n):\n        ls[i] = [h[i]]\n    ab = []\n    for i in range(m):\n        ab.append(list(map(lambda i:int(i)-1, input().split(\" \"))))\n    for i in range(m):\n        if ls[ab[i][0]][0] >= ls[ab[i][1]][0]:\n            ls[ab[i][1]].append(ls[ab[i][0]][0]+1)\n        if ls[ab[i][1]][0] >= ls[ab[i][0]][0]:\n            ls[ab[i][0]].append(ls[ab[i][1]][0] + 1)\n    cnt = 0\n    for i in range(n):\n        if ls[i][0] == max(ls[i]):\n            cnt += 1\n    print(cnt)\n\n        \n\n    \n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14420.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nway=[[] for i in range(n)]\nH = list(map(int,input().split()))\nfor i in range(m):\n    a,b=map(int,input().split())\n    way[a-1].append(b-1)\n    way[b-1].append(a-1)\n\nfor i in range(n):\n    way[i]=list(set(way[i]))\n\nans=0\nfor i in range(n):\n    high=True\n    for j in way[i]:\n        if H[i]<=H[j]:\n            high=0\n            break\n    if high:\n        ans+=1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\ngraph = [[] for _ in range(N)]\n\nfor query in range(M):\n    a, b = map(int, input().split())\n    a -= 1\n    b -= 1\n    graph[a].append(b)\n    graph[b].append(a)\n\nans = 0\n\nfor now in range(N):\n    good = True\n    for neighbor in graph[now]:\n        if H[now] <= H[neighbor]:\n            good = False\n    if good:\n        ans += 1\n        #print(now)\n\nprint(ans)", "passed": true, "time": 0.22, "memory": 14356.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nways = [list(map(int, input().split())) for i in range(M)]\nobservatoryList = [1] * N\nfor i in range(M):\n  if H[ways[i][0] - 1] <= H[ways[i][1] - 1]:\n    observatoryList[ways[i][0] - 1] = 0\n  if H[ways[i][0] - 1] >= H[ways[i][1] - 1]:\n    observatoryList[ways[i][1] - 1] = 0\ngoodObservatoryCount = observatoryList.count(1)\nprint(goodObservatoryCount)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "# n\u306f\u5c55\u671b\u53f0\u306e\u6570\u3000m\u306f\u9053\u306e\u6570\nn,m = list(map(int,input().split()))\nhigh = list(map(int,input().split()))\n\na = []\n\nfor x in range(m):\n    b = list(map(int,input().split()))\n    a.append(b)\n\n\nloser = []\n\nfor y in a:\n    high1 = high[y[0]-1]\n    high2 = high[y[1]-1]\n    if high1 > high2:\n        loser.append(y[1])\n    elif high1 ==  high2:\n        loser.append(y[0])\n        loser.append(y[1])\n    else:\n        loser.append(y[0])\n\nnew_loser = list(set(loser))\nprint((n-len(new_loser)))\n", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nh = list(map(int, input().split()))\nc = [[] for _ in range(n)]\nfor _ in range(m):\n    a, b = map(int, input().split())\n    a, b = a-1, b-1\n    c[a].append(b)\n    c[b].append(a)\n\nans = 0\nfor i in range(n):\n    high = h[i]\n    for j in c[i]:\n        if h[j] >= high:\n            break\n    else:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14252.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nflg = [1]*n\nfor _ in range(m):\n    a,b = map(int,input().split())\n    if h[a-1] > h[b-1]:\n        flg[b-1] = 0\n    elif h[a-1] == h[b-1]:\n        flg[a-1],flg[b-1] = 0,0\n    else:\n        flg[a-1] = 0\nprint(flg.count(1))", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n,m = [int(x) for x in input().split()]\nh = [int(x) for x in input().split()]\na,b = [],[]\nfor i in range(m):\n  a1,b1 = [int(x) for x in input().split()]\n  a.append(a1-1)\n  b.append(b1-1)\nans = [1] * n\nfor i in range(m):\n  if h[a[i]] < h[b[i]]:\n    ans[a[i]] = 0\n  elif h[a[i]] > h[b[i]]:\n    ans[b[i]] = 0\n  else:\n    ans[a[i]] = 0\n    ans[b[i]] = 0\nc = 0\nfor i in range(n):\n  if ans[i] == 1:\n    c += 1\n#print(ans)\nprint(c)", "passed": true, "time": 0.37, "memory": 14236.0, "status": "done"}, {"code": "n,m=map(int,input().split())                       \nh =list(map(int,input().split()))\ncnt = 0\nl = [[] for i in range(n)]\nfor i in range(m):\n    a,b=map(int,input().split()) \n    l[a-1].append(h[b-1])\n    l[b-1].append(h[a-1])\n\nfor i in range(n):\n    if l[i] == []:\n        cnt+=1\n\n    elif h[i] > max(l[i]):\n        cnt +=1\n    \n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict, deque, Counter\nfrom copy import deepcopy\nfrom bisect import bisect, bisect_right, bisect_left\nfrom heapq import heapify, heappop, heappush\n    \ninput = sys.stdin.readline\ndef RD(): return input().rstrip()\ndef F(): return float(input().rstrip())\ndef I(): return int(input().rstrip())\ndef MI(): return map(int, input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int, input().split()))\ndef TI(): return tuple(map(int, input().split()))\ndef LF(): return list(map(float,input().split()))\ndef Init(H, W, num): return [[num for i in range(W)] for j in range(H)]\n    \n    \ndef main():\n    N, M = MI()\n    H = LI()\n    G = [[] for i in range(N)]\n    for i in range(M):\n        a, b = MI()\n        G[a-1].append(b-1)\n        G[b-1].append(a-1)\n    res = [-1] * N\n    for i in range(N):\n        if res[i] != -1:\n            continue\n        h = H[i]\n        ans = True\n        for index in G[i]:\n            temp_H = H[index]\n            if h > temp_H:\n                res[index] = 0\n            else:\n                ans = False\n                break\n        if ans:\n            res[i] = 1\n        else:\n            res[i] = 0\n    ans = 0\n    for i in res:\n        if i != 0:\n            ans+=1\n    print(ans)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.39, "memory": 14280.0, "status": "done"}, {"code": "N,M = map(int,input().split())\n\nH = list(map(int,input().split()))\n\nans = 0\n\nH2 = []\nfor i in range(N):\n    H2.append([0])\n\nfor i in range(M):\n    A,B = map(int,input().split())\n    \n    H2[A-1].append(H[B-1])\n    H2[B-1].append(H[A-1])\n\nfor i in range(N):\n    H2[i] = max(H2[i])\n\nfor i in range(N):\n    if H2[i] < H[i]:\n        ans += 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nl=[1]*n\nfor i in range(m):\n  a,b=map(int,input().split())\n  if h[a-1]==h[b-1]:\n    l[a-1]=0\n    l[b-1]=0\n  if h[a-1]>h[b-1]:\n    l[b-1]=0\n  if  h[a-1]<h[b-1]:\n    l[a-1]=0\nprint(l.count(1))", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nH = list(map(int, input().split()))\ng = [1]*n\n\nfor i in range(m):\n    a, b = map(int, input().split())\n    a -= 1\n    b -= 1\n    if H[a]<H[b]:\n        g[a] = 0\n    elif H[a]>H[b]:\n        g[b] = 0\n    else:\n        g[a] = g[b] = 0\nprint(sum(g))", "passed": true, "time": 0.23, "memory": 14292.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nA = [True for i in range(N)]\nfor i in range(M) :\n    a,b = map(int, input().split())\n    a -= 1\n    b -= 1\n    if(H[a] <= H[b]) :\n        A[a] = False\n    if(H[b] <= H[a]) :\n        A[b] = False\n\nans = 0\nfor i in range(N) :\n    if(A[i]) :\n        ans += 1\nprint(ans)", "passed": true, "time": 0.16, "memory": 14348.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\nglaph = [[] for _ in range(N)]\n\nfor i in range(M):\n  A,B = map(int,input().split())\n  A -= 1\n  B -= 1\n  glaph[A].append(B)\n  glaph[B].append(A)\n  \nans = 0\nfor j in range(N):\n  check = True\n  for k in glaph[j]:\n    if H[j] <= H[k]:\n      check = False\n      break\n  if check:\n    ans += 1\n    \nprint(ans)", "passed": true, "time": 0.23, "memory": 14288.0, "status": "done"}, {"code": "[N, M] = [int(i) for i in input().split()]\nH = [int(i) for i in input().split()]\ndic = {}\nfor i in range(M):\n    [a, b] = [int(i) for i in input().split()]\n    if a in dic:\n        dic[a].append(b)\n    else:\n        dic[a] = [b]\n    if b in dic:\n        dic[b].append(a)\n    else:\n        dic[b] = [a]\n\nans = 0\nfor i in range(1, N+1):\n    s = H[i-1]\n    t = 0\n    if i in dic:\n        for j in range(len(dic[i])):\n            if s <= H[dic[i][j]-1]:\n                t += 1\n                break\n        if t == 0:\n            ans += 1\n    else:\n        ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14372.0, "status": "done"}, {"code": "n,m = list(map(int,input().split()))\nh = list(map(int,input().split()))\nab = [list(map(int,input().split())) for _ in range(m)]\n\nplace = [True]*n\n\nfor i in range(m):\n    a,b = ab[i][0],ab[i][1]\n    if h[a-1] < h[b-1]:\n        place[a-1] = False\n    elif h[a-1] == h[b-1]:\n        place[a-1] = False\n        place[b-1] = False\n    else:\n        place[b-1] = False\n\nprint((place.count(True)))\n", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\narray = [0] * N\nans = 0\n\nfor i in range(M):\n    A, B = map(int, input().split())\n    A -= 1\n    B -= 1\n    array[A] = max(array[A], H[B])\n    array[B] = max(array[B], H[A])\n\nfor j in range(N):\n    if array[j] < H[j]:\n      ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\na, b = [list(i) for i in zip(*ab)]\nl = [1 for _ in range(n)]\n\nfor i in range(m):\n    if h[a[i]-1] < h[b[i]-1]:\n        l[a[i]-1] = 0\n    elif h[a[i]-1] > h[b[i]-1]:\n        l[b[i]-1] = 0\n    else:\n        l[b[i]-1] = 0\n        l[a[i]-1] = 0\n\nprint((l.count(1))) \n", "passed": true, "time": 0.15, "memory": 14356.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = [int(i) for i in input().split()]\nA = []\nB = []\nfor i in range(M):\n    a,b = map(int,input().split())\n    A.append(a)\n    B.append(b)\nI = []\nans = 0\nfor i in range(1,N+1):\n    I.append([i])\nfor i in range(M):\n    I[A[i]-1].append(B[i])\n    I[B[i]-1].append(A[i])\nfor i in range(N):\n    count = 0\n    a = H[i]\n    if(count < 2):\n        for j in range(len(I[i])):\n            if(H[I[i][j]-1] >= a):\n                count += 1\n    if(count < 2):\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "def __starting_point():\n\n    #\u96a3\u63a5\u30ea\u30b9\u30c8(graph)\n    n,m = list(map(int,input().split()))\n    H = [int(h) for h in input().split()]\n\n    graph = [[]for _ in range(n)]\n\n    for _ in range(m):\n        a,b = list(map(int,input().split()))\n        graph[a-1].append(b-1)\n        graph[b-1].append(a-1)\n\n    #\u3053\u306e\u30ea\u30b9\u30c8\u304b\u3089\u76f8\u624b\u3068\u306e\u95a2\u4fc2\u3092\u8abf\u3079\u3066\u3088\u3044\u5c55\u671b\u53f0\u304b\u3069\u3046\u304b\u8abf\u3079\u308b\uff1f\n    good = 0\n    for i,g in enumerate(graph):\n        moto = H[i]\n        flg = True\n        for sk in g:\n            saki = H[sk]\n            if moto <= saki:\n                flg = False\n                break\n        if flg:\n            good += 1\n    print(good)\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "# C - Peaks\n\nn,m = list(map(int, input().split()))\nh = list(map(int,input().split()))\nab = []\nfor i in range(m):\n    ab.append(list(map(int,input().split())))\n\npeak = [1]*n\nfor i in range(m):\n    if h[ab[i][0]-1] >= h[ab[i][1]-1]:\n        peak[ab[i][1]-1] = 0\n    if h[ab[i][0]-1] <= h[ab[i][1]-1]:\n        peak[ab[i][0]-1] = 0\nprint((sum(peak)))\n", "passed": true, "time": 0.24, "memory": 14100.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nla = [0] * n\nfor i in range(m):\n    a,b = map(int,input().split())\n    a -= 1\n    b -= 1\n    la[a] = max(la[a],h[b])\n    la[b] = max(la[b],h[a])\n\nans = 0\n    \nfor i in range(n):\n    if la[i] < h[i]:\n        ans += 1\n        \nprint(ans)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\nans = [1]*n\nfor i in range(m):\n    if h[ab[i][0]-1] == h[ab[i][1]-1]:\n        ans[ab[i][0]-1] = 0\n        ans[ab[i][1]-1] = 0\n    elif h[ab[i][0]-1] > h[ab[i][1]-1]:\n        ans[ab[i][1]-1] = 0\n    else:\n        ans[ab[i][0]-1] = 0\nprint((sum(ans)))\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "N, M = list(map(int,input().split()))\nH = list(map(int,input().split()))\nAB = [list(map(int,input().split())) for _ in range(M)]\n\npath = [[] for _ in range(N)]\nfor a,b in AB:\n  a,b = a-1, b-1\n  path[a].append(b)\n  path[b].append(a)\n  \nans = 0\nfor i,p in enumerate(path):\n  h = H[i]\n  tmp = 0\n  for pp in p:\n    tmp = max(tmp, H[pp])\n  if tmp<h:\n    ans+=1\n  \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n\nN, M = list(map(int, input().split()))\nh_list = list(map(int, input().split()))\nh_dict = {i + 1: h for i, h in enumerate(h_list)}\nh_set = set(h_dict.keys())\nno_list = []\n\nfor _ in range(M):\n    a, b = list(map(int, input().split()))\n    if h_dict[a] == h_dict[b]:\n        no_list.append(a)\n        no_list.append(b)\n    elif h_dict[a] > h_dict[b]:\n        no_list.append(b)\n    else:\n        no_list.append(a)\n\nno_set = set(no_list)\nans = len(h_set - no_set)\n\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14128.0, "status": "done"}, {"code": "n, m = map(int, input().split())\nh = list(map(int, input().split()))\nD = dict()\nfor i in range(1, n+1):\n    D[i] = h[i-1]\nL = [1 for i in range(n)]\nfor _ in range(m):\n    a, b =map(int, input().split())\n    if D[a] > D[b]:\n        L[b-1] = 0\n    elif D[a] == D[b]:\n        L[a-1] = 0\n        L[b-1] = 0\n    else:\n        L[a-1] = 0\nans = 0\nfor e in L:\n    ans += e\nprint(ans)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "\n\nN, M = map(int,input().split())\nH = list(map(int, input().split()))\nA = [0]*M\nB = [0]*M\nLists = [[] for _ in range(N)]\nfor i in range(M):\n    A[i], B[i] = map(lambda x: int(x)-1, input().split())\n    Lists[A[i]].append(B[i]) \n    Lists[B[i]].append(A[i]) \n\n#print(Lists)\nans = 0\nfor i in range(N):\n    Heighest = 0\n    #print(Lists[i])\n    #print(\"H[i]:\", H[i])\n    for j in range(len(Lists[i])):\n        #print(\"H[List[i][j]]:\", H[Lists[i][j]])  \n        Heighest = max(Heighest, H[ Lists[i][j] ])\n    #print(Heighest)\n    #print(H[i])\n    if Heighest <H[i]:\n        #print(\"Heighest = \", Heighest)\n        ans += 1\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\nr=[]\n\nt=['W']*n\n\nfor i in range(m):\n    a,b=list(map(int,input().split()))\n    if h[a-1]>=h[b-1]:\n        t[b-1]='L'\n    if h[a-1]<=h[b-1]:\n        t[a-1]='L'\nprint(t.count('W'))", "passed": true, "time": 0.24, "memory": 14064.0, "status": "done"}, {"code": "n, m = list(map(int,input().split()))\nlst = list(map(int,input().split()))\nlst2 = []\nfor i in range(n):\n    lst3 = [lst[i]]\n    lst2.append(lst3)\n\nfor i in range(m):\n    a, b = list(map(int,input().split()))\n    a = a - 1\n    b = b - 1\n    lst2[a].append(lst2[b][0])\n    lst2[b].append(lst2[a][0])\n\nans = 0\nfor i in range(n):\n    x = lst2[i][0]\n    lst2[i].sort()\n    lst2[i].reverse()\n    if (len(lst2[i]) == 1):\n        ans = ans + 1\n    elif (x == lst2[i][0]):\n        lst2[i].pop(0)\n        y = lst2[i][0]\n        if (x != y):\n            ans = ans + 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n,m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nhoge = [[] for _ in range(n)]\nfor i in range(m):\n  a,b = list(map(int, input().split()))\n  hoge[a - 1].append(b - 1)\n  hoge[b - 1].append(a - 1)\n  \ncnt = 0\nfor i in range(n):\n  if hoge[i]:\n    flag = True\n    for j in hoge[i]:\n      if h[i] <= h[j]:\n        flag = False\n    if flag:\n      cnt += 1\n  else:\n    cnt += 1\n        \nprint(cnt)", "passed": true, "time": 0.24, "memory": 14264.0, "status": "done"}, {"code": "import copy\n\nn,m = list(map(int, input().split()))\nh = [0] + list(map(int, input().split()))\n\ntowers = [[] for _ in range(n + 1)]\n\nfor i in range(m):\n    a, b = list(map(int, input().split()))\n    towers[a].append(b)\n    towers[b].append(a)\n\ncnt = 0\nfor i in range(1, n + 1):\n    for j in towers[i]:\n        if h[i] <= h[j]:\n            break\n    else:\n        cnt += 1\n\nprint(cnt)\n            \n", "passed": true, "time": 0.25, "memory": 14176.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nh=list(map(int,input().split()))\nA=[[] for i in range(n)]\nfor i in range(m) :\n    a,b=list(map(int,input().split()))\n    A[a-1].append(h[b-1])\n    A[b-1].append(h[a-1])\n\ncount=0\nfor i in range(n) :\n    if A[i]==[] :\n        count+=1\n    elif max(A[i])<h[i] :\n        count+=1\n    else :\n        continue\n\nprint(count)    \n\n", "passed": true, "time": 0.25, "memory": 14108.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\nh = list(map(int, input().split()))\nneighbor = [[] for _ in range(n)]\n\nfor i in range(m):\n    a, b = list(map(int, input().split()))\n    neighbor[a - 1].append(b - 1)\n    neighbor[b - 1].append(a - 1)\n\ncnt = 0\nfor i in range(n):\n    if all([h[i] > h[j] for j in neighbor[i]]):\n        cnt += 1\nprint(cnt)", "passed": true, "time": 0.6, "memory": 14244.0, "status": "done"}, {"code": "N, M = list(map(int, input().split()))\nH = list(map(int, input().split()))\npeaks = [1] * N\nfor i in range(M):\n    A, B = list(map(int, input().split()))\n    if H[A - 1] > H[B - 1]:\n        peaks[B - 1] = 0\n    elif H[B - 1] > H[A - 1]:\n        peaks[A - 1] = 0\n    else:\n        peaks[A - 1] = 0\n        peaks[B - 1] = 0\n\nprint((sum(peaks)))\n", "passed": true, "time": 0.15, "memory": 14156.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nH = list(map(int,input().split()))\nL = [1]*n\nfor _ in range(m):\n  a,b = map(int,input().split())\n  if H[a-1] == H[b-1]:\n    L[a-1] = 0\n    L[b-1] = 0\n  elif H[a-1] < H[b-1]:\n    L[a-1] = 0\n  elif H[a-1] > H[b-1]:\n    L[b-1] = 0\nprint(sum(L))", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "from collections import defaultdict\n\nN, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nedge = defaultdict(list)\n\nfor i in range(M):\n    a, b = map(int, input().split())\n    edge[a - 1].append(H[b - 1])\n    edge[b - 1].append(H[a - 1])\n\nans = 0\nfor i in range(N):\n    if len(edge[i]) == 0 or H[i] > max(edge[i]):\n        ans += 1\n\nprint(ans)", "passed": true, "time": 0.15, "memory": 14104.0, "status": "done"}, {"code": "def main():\n    n, m = list(map(int, input().split()))\n    h = list(map(int, input().split()))\n    hf = [0] * n\n    for i in range(m):\n        a, b = list(map(int, input().split()))\n        if h[a-1] > h[b-1]:\n            hf[b-1] = 1\n        elif h[a-1] == h[b-1]:\n            hf[a-1] = 1\n            hf[b-1] = 1\n        else:\n            hf[a-1] = 1\n    print(hf.count(0))\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nimport sys\nfrom itertools import chain\n\n\ndef solve(\n    N: int, M: int, H: \"List[int]\", A: \"List[int]\", B: \"List[int]\"\n):\n    ok = [1 for _ in range(N)]\n    for a, b in zip(A, B):\n        if H[a - 1] <= H[b - 1]:\n            ok[a - 1] = 0\n        if H[b - 1] <= H[a - 1]:\n            ok[b - 1] = 0\n\n    return sum(ok)\n\n\ndef main():\n    tokens = chain(*(line.split() for line in sys.stdin))\n    N = int(next(tokens))  # type: int\n    M = int(next(tokens))  # type: int\n    H = [int(next(tokens)) for _ in range(N)]  # type: \"List[int]\"\n    A = [int()] * (M)  # type: \"List[int]\"\n    B = [int()] * (M)  # type: \"List[int]\"\n    for i in range(M):\n        A[i] = int(next(tokens))\n        B[i] = int(next(tokens))\n    answer = solve(N, M, H, A, B)\n    print(answer)\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14168.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nway=[[] for i in range(n)]\nH = list(map(int,input().split()))\nfor i in range(m):\n    a,b=map(int,input().split())\n    way[a-1].append(b-1)\n    way[b-1].append(a-1)\nans=0\nfor i in range(n):\n    high=True\n    for j in way[i]:\n        if H[i]<=H[j]:\n            high=0\n            break\n    if high:\n        ans+=1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14112.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = [0] + list(map(int, input().split()))\n\ng = [[] for _ in range(N+1)]\nfor i in range(M):\n  a, b = map(int, input().split())\n  g[a].append(b)\n  g[b].append(a)\n\nans = 0\nfor j in range(1, N+1):\n  for k in g[j]:\n    if H[j] <= H[k]:\n      break\n  else:\n    ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "# coding=utf-8\n\ndef __starting_point():\n    N, M = list(map(int, input().split()))\n    Hli = list(map(int, input().split()))\n\n    #road = [[0] * 2 for i in range(M)]\n\n    ans = [0] * N\n\n    for i in range(M):\n        A, B = list(map(int, input().split()))\n\n        if Hli[A-1] < Hli[B-1]:\n            ans[A-1] += 1\n\n        elif Hli[A-1] == Hli[B-1]:\n            ans[A - 1] += 1\n            ans[B - 1] += 1\n            \n        else:\n            ans[B-1] +=1\n\n    #print(ans)\n    print((ans.count(0)))\n\n__starting_point()", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split()))\nOK = [True] * N\nfor _ in range(M):\n    A, B = map(lambda x: int(x)-1, input().split())\n    if H[A] < H[B]:\n        OK[A] = False\n    elif H[A] > H[B]:\n        OK[B] = False\n    else:\n        OK[A] = False\n        OK[B] = False\n\nans = sum(OK)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n, m = list(map(int, input().split()))\narr = [0] + list(map(int, input().split()))\ng = [[] for _ in range(n + 1)]\nfor _ in range(m):\n    a, b = list(map(int, input().split()))\n    g[a].append(b)\n    g[b].append(a)\n\nans = 0\nfor i in range(1, n + 1):\n    for j in g[i]:\n        if arr[j] >= arr[i]:\n            break\n    else:\n        ans += 1\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "N,M = map(int,input().split())\nH = list(map(int,input().split()))\nmx = [0 for i in range(N)]\nfor _ in range(M):\n    a,b = map(int,input().split())\n    a -= 1\n    b -= 1\n    mx[a] = max(mx[a], H[b])\n    mx[b] = max(mx[b], H[a])\nans = 0\nfor i in range(N):\n    if H[i] > mx[i]:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n,m = map(int,input().split())\nh = list(map(int,input().split()))\nl = list({i} for i in range(n+1))\nfor i in range(m):\n    a,b = map(int,input().split())\n    l[a].add(b)\n    l[b].add(a)\n    \nfor i in range(len(l)):\n    l[i] = list(l[i])\ngood = set()\nfor i in range(1,len(l)):\n    l[i].remove(i)\n    for j in range(len(l[i])):\n        if h[l[i][j]-1] >= h[i-1]:\n            break\n    else:\n        good.add(i)\nprint(len(good))", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "n,m=list(map(int,input().split()))\nl=list(map(int,input().split()))\nans=[1]*n\nfor i in range(m):\n    a,b=list(map(int,input().split()))\n    if l[a-1]<l[b-1]:\n        ans[a-1]=0\n    elif l[a-1]>l[b-1]:\n        ans[b-1]=0\n    else:\n        ans[a-1]=0\n        ans[b-1]=0\nprint((sum(ans)))\n", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "n,m=map(int,input().split())\nh=list(map(int,input().split()))\n\nt=['W']*n\n\nfor i in range(m):\n    a,b=map(int,input().split())\n    if h[a-1]>=h[b-1]:\n        t[b-1]='L'\n    if h[a-1]<=h[b-1]:\n        t[a-1]='L'\nprint(t.count('W'))", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n,m = map(int, input().split())\nh = list(map(int, input().split()))\nab = [map(int, input().split()) for _ in range(m)]\na,b = [list(i) for i in zip(*ab)]\nMax = []\nfor i in range(n):\n    Max.append(0)\n# print(Max)\nans = 0\nfor i in range(m):\n    Max[a[i]-1] = max(Max[a[i]-1],h[b[i]-1])\n    Max[b[i]-1] = max(Max[b[i]-1],h[a[i]-1])\n\nfor i in range(n):\n    if h[i] > Max[i]:\n        ans += 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "N, M = map(int, input().split())\nH = list(map(int, input().split())) #\u5c55\u671b\u53f0i\u306e\u6a19\u9ad8\nassert len(H) == N\npaths = [[] for i in range(N)]\nfor m in range(M):\n  a, b = map(int, input().split())\n  a -= 1\n  b -= 1\n  paths[a].append(b)\n  paths[b].append(a) # \u5c55\u671b\u53f0A\u304b\u3089B\u3078\u306e\u9053\u3001\u305d\u306e\u9006\n\ncount = 0\nfor a in range(N):\n  for b in paths[a]:\n    if H[b] >= H[a]:\n      break\n  else:\n    count += 1\nprint(count)", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}]