Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b] = 1
    elif ha < hb:
        bad_tower[a] = 1
    elif ha == hb:
        bad_tower[a] = 1
        bad_tower[b] = 1

ans = n - np.sum(bad_tower)

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((), dtype='int')

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

    if ha > hb:
        bad_tower = np.append(bad_tower, b)
    elif ha < hb:
        bad_tower = np.append(bad_tower, a)
    elif ha == hb:
        bad_tower = np.append(bad_tower, a)
        bad_tower = np.append(bad_tower, b)

bad_tower = np.unique(bad_tower)

ans = n - len(bad_tower) + 1

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((), dtype='int')

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

    if ha > hb:
        bad_tower = np.append(bad_tower, b)
    elif ha < hb:
        bad_tower = np.append(bad_tower, a)
    elif ha == hb:
        bad_tower = np.append(bad_tower, a)
        bad_tower = np.append(bad_tower, b)

bad_tower = set(bad_tower)

ans = n - len(bad_tower) + 1

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((), dtype='int')

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

    if ha > hb:
        bad_tower = np.append(bad_tower, b)
    elif ha < hb:
        bad_tower = np.append(bad_tower, a)
    elif ha == hb:
        bad_tower = np.append(bad_tower, a)
        bad_tower = np.append(bad_tower, b)

bad_tower = np.array(list(set(bad_tower)))

ans = n - len(bad_tower) + 1

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
good_tower = np.arange(1, n+1)
bad_tower = np.zeros((), dtype='int')

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

    if h[a-1] > h[b-1]:
        bad_tower = np.append(bad_tower, b)
    elif h[a-1] < h[b-1]:
        bad_tower = np.append(bad_tower, a)
    elif h[a-1] == h[b-1]:
        bad_tower = np.append(bad_tower, a)
        bad_tower = np.append(bad_tower, b)

bad_tower = np.array(list(set(bad_tower)))

ans = len(good_tower) - len(bad_tower) + 1

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
good_tower = np.arange(1, n+1)
bad_tower = np.zeros((), dtype='int')

for i in range(m):
    way = np.array(input().split(), dtype='int')

    if h[way[0]-1] > h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[1])
    elif h[way[0]-1] < h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[0])
    elif h[way[0]-1] == h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[0])
        bad_tower = np.append(bad_tower, way[1])

bad_tower = np.array(list(set(bad_tower)))

ans = len(good_tower) - len(bad_tower) + 1

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split())
good_tower = np.arange(1, n+1)

for i in range(m):
    way = np.array(input().split(), dtype='int')

    if h[way[0]-1] > h[way[1]-1]:
        good_tower = np.delete(good_tower, np.where(good_tower == way[1]))
    elif h[way[0]-1] < h[way[1]-1]:
        good_tower = np.delete(good_tower, np.where(good_tower == way[0]))
    elif h[way[0]-1] == h[way[1]-1]:
        good_tower = np.delete(good_tower, np.where(good_tower == way[0]))
        good_tower = np.delete(good_tower, np.where(good_tower == way[1]))

print(len(good_tower))

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
good_tower = np.arange(1, n+1)
bad_tower = np.zeros((), dtype='int')

for i in range(m):
    way = np.array(input().split(), dtype='int')

    if h[way[0]-1] > h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[1])
    elif h[way[0]-1] < h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[0])
    elif h[way[0]-1] == h[way[1]-1]:
        bad_tower = np.append(bad_tower, way[0])
        bad_tower = np.append(bad_tower, way[1])

bad_tower = np.array(list(set(bad_tower)))

for i in bad_tower:
    good_tower = good_tower[~(good_tower == i)]

print(len(good_tower))

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split())
good_tower = np.arange(1, n+1)

for i in range(m):
    way = np.array(input().split(), dtype='int')

    if h[way[0]-1] > h[way[1]-1]:
        good_tower = good_tower[~(good_tower == way[1])]
    elif h[way[0]-1] < h[way[1]-1]:
        good_tower = good_tower[~(good_tower == way[0])]
    elif h[way[0]-1] == h[way[1]-1]:
        good_tower = good_tower[~(good_tower == way[1])]
        good_tower = good_tower[~(good_tower == way[0])]

print(len(good_tower))

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

n, m = map(int, input().split())
h = np.array(input().split(), dtype='int')
bad_tower = np.zeros((n), dtype='int')

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

    if ha > hb:
        bad_tower[b-1] = 1
    elif ha < hb:
        bad_tower[a-1] = 1
    elif ha == hb:
        bad_tower[a-1] = 1
        bad_tower[b-1] = 1

ans = n - np.sum(bad_tower)

print(ans)