Buggy python submission (verdict: Time Limit Exceeded):
#データ入力
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
kind_load = []
for i in range(num_load):
    line = input().rstrip().split(" ")
    line_int = [int(n) for n in line]
    kind_load.append(line_int)
ans = [t+1 for t in range(num_high) ]
kind_load.sort()

#j番目を選ぶ
for j in range(num_high):
    #print(ans)
    choice = j+1
    #J番目の展望台のある道路を探す
    for list in kind_load:
        if choice in list:
            #比較のため、データを取り出す
            choose = list.index(choice)
            check_a = int(list[choose])
            if choose == 1:
                check_b = int(list[0])
            else:
                check_b = int(list[1])
            #比較
            if int(height[check_a - 1]) <= int(height[check_b - 1]):
                del list
                if check_a in ans:
                    link = ans.index(check_a)
                    del ans[link]
print(len(ans))

Fixed submission:
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
ans = [0 for i in range(num_high)]

for j in range(num_load):
    list = input().rstrip().split(" ")
    check_a = int(list[0])
    check_b = int(list[1])
    if int(height[check_a-1]) <= int(height[check_b-1]):
        ans[check_a-1] = 1
    if int(height[check_b-1]) <= int(height[check_a-1]):
        ans[check_b-1] = 1
print(ans.count(0))

Buggy python submission (verdict: Time Limit Exceeded):
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
kind_load = []
for i in range(num_load):
    line = input().rstrip().split(" ")
    kind_load.append(line)
ans = [t+1 for t in range(num_high) ]

#j番目を選ぶ
for j in range(num_high):
    #print(ans)
    choice = j+1
    #J番目の展望台のある道路を探す
    for list in kind_load:
        if str(choice) in list:
            #比較のため、データを取り出す
            choose = list.index(str(choice))
            check_a = int(list[choose])
            if choose == 1:
                check_b = int(list[0])
            else:
                check_b = int(list[1])
            #比較
            if int(height[check_a - 1]) <= int(height[check_b - 1]):
                del list
                if check_a in ans:
                    link = ans.index(check_a)
                    del ans[link]
print(len(ans))


Fixed submission:
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
ans = [0 for i in range(num_high)]

for j in range(num_load):
    list = input().rstrip().split(" ")
    check_a = int(list[0])
    check_b = int(list[1])
    if int(height[check_a-1]) <= int(height[check_b-1]):
        ans[check_a-1] = 1
    if int(height[check_b-1]) <= int(height[check_a-1]):
        ans[check_b-1] = 1
print(ans.count(0))

Buggy python submission (verdict: Time Limit Exceeded):
#データ入力
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
kind_load = []
for i in range(num_load):
    line = input().rstrip().split(" ")
    kind_load.append(line)

#j番目を選ぶ
for j in range(num_high):
    #print(ans)
    choice = j+1
    #J番目の展望台のある道路を探す
    for list in kind_load:
        if str(choice) in list:
            #比較のため、データを取り出す
            choose = list.index(str(choice))
            check_a = int(list[choose])
            if choose == 1:
                check_b =int(list[0])
            else:
                check_b = int(list[1])
            #比較
            if int(height[check_a - 1]) <= int(height[check_b - 1]):
                ans -= 1
                break
print(ans)

Fixed submission:
total = input().rstrip().split(" ")
num_high = int(total[0])
ans = num_high
num_load = int(total[1])
height = input().rstrip().split(" ")
ans = [0 for i in range(num_high)]

for j in range(num_load):
    list = input().rstrip().split(" ")
    check_a = int(list[0])
    check_b = int(list[1])
    if int(height[check_a-1]) <= int(height[check_b-1]):
        ans[check_a-1] = 1
    if int(height[check_b-1]) <= int(height[check_a-1]):
        ans[check_b-1] = 1
print(ans.count(0))