Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().rstrip().split())
h = map(int, input().rstrip().split())
l = []
high = [0] * n
count = 0

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

for i in l:
    if h[i[0]-1] < h[i[1]-1]:
        high[i[0]-1] += 1
    elif h[i[0]-1] == h[i[1]-1]:
        high[i[0]-1] += 1
        high[i[1]-1] += 1
    else:
        high[i[1]-1] += 1

for hi in high:
    if hi == 0:
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
l = []
high = [0] * n
count = 0

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

for i in l:
    if h[i[0]-1] < h[i[1]-1]:
        high[i[0]-1] += 1
    elif h[i[0]-1] == h[i[1]-1]:
        high[i[0]-1] += 1
        high[i[1]-1] += 1
    else:
        high[i[1]-1] += 1

for hi in high:
    if hi == 0:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
a_b = [list(map(int, input().rstrip().split())) for i in range(m)]
for i in range(m):
    a_b[i][0] = a_b[i][0] - 1
    a_b[i][1] = a_b[i][1] - 1
count = 0

for i in range(n):
    temp = set()
    for j in range(m):
        if a_b[j][0] == i:
            temp.add(a_b[j][1])
        if a_b[j][1] == i:
            temp.add(a_b[j][0])
    high = [h[k] for k in temp]
    if len(temp)==0 or h[i] > max(high):
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
l = []
high = [0] * n
count = 0

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

for i in l:
    if h[i[0]-1] < h[i[1]-1]:
        high[i[0]-1] += 1
    elif h[i[0]-1] == h[i[1]-1]:
        high[i[0]-1] += 1
        high[i[1]-1] += 1
    else:
        high[i[1]-1] += 1

for hi in high:
    if hi == 0:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
a_b = [list(map(int, input().rstrip().split())) for i in range(m)]
for i in range(m):
    a_b[i][0] = a_b[i][0] - 1
    a_b[i][1] = a_b[i][1] - 1
count = 0

for i in range(n):
    temp = set()
    for j in range(m):
        if a_b[j][0] == i:
            temp.add(a_b[j][1])
        if a_b[j][1] == i:
            temp.add(a_b[j][0])
    high = [h[k] for k in temp]
    if len(temp)==0 or h[i] > max(high):
        count += 1
print(count)

Fixed submission:
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
l = []
high = [0] * n
count = 0

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

for i in l:
    if h[i[0]-1] < h[i[1]-1]:
        high[i[0]-1] += 1
    elif h[i[0]-1] == h[i[1]-1]:
        high[i[0]-1] += 1
        high[i[1]-1] += 1
    else:
        high[i[1]-1] += 1

for hi in high:
    if hi == 0:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
a_b = [list(map(int, input().rstrip().split())) for i in range(m)]
for i in range(m):
    a_b[i][0] = a_b[i][0] - 1
    a_b[i][1] = a_b[i][1] - 1
count = 0

for i in range(n):
    temp = set()
    for j in range(m):
        if a_b[j][0] == i:
            temp.add(a_b[j][1])
        if a_b[j][1] == i:
            temp.add(a_b[j][0])
    high = h[i]
    num = 0
    for k in temp:
        if high == h[k]:
            num += 1
        high = max(high, h[k])
    if (h[i] == high and num != len(temp)) or len(temp)==0:
        count += 1

print(count)

Fixed submission:
n, m = map(int, input().rstrip().split())
h = list(map(int, input().rstrip().split()))
l = []
high = [0] * n
count = 0

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

for i in l:
    if h[i[0]-1] < h[i[1]-1]:
        high[i[0]-1] += 1
    elif h[i[0]-1] == h[i[1]-1]:
        high[i[0]-1] += 1
        high[i[1]-1] += 1
    else:
        high[i[1]-1] += 1

for hi in high:
    if hi == 0:
        count += 1
print(count)