Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    edges = np.zeros((N, N))
        
    for itr in range(M):
        A, B = list(map(int, input().split()))
        edges[A- 1][B- 1] = H[B- 1]
        edges[B- 1][A- 1] = H[A- 1]
    
    result = 0
    for itr in range(N):
        count = 1
        for inner_itr in range(N):
            if edges[itr][inner_itr] >= H[itr] :
                count = 0
                break
        result += count
        #print(itr, result, H[itr])
    
    print(result)
    #print(edges)

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
import copy

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    maxH  = np.zeros(N)

    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A- 1] == H[B- 1] :
            maxH[A- 1] = copy.copy(H[A- 1]) + 1
            maxH[B- 1] = copy.copy(H[A- 1]) + 1
        elif H[A- 1] > H[B- 1] :
            if maxH[A- 1] < H[A- 1] :
                maxH[A- 1] = copy.copy(H[A- 1])
            if maxH[B- 1] < H[A- 1] :
                maxH[B- 1] = copy.copy(H[A- 1])
        elif H[A- 1] < H[B- 1] :
            if maxH[A- 1] < H[B- 1] :
                maxH[A- 1] = copy.copy(H[B- 1])
            if maxH[B- 1] < H[B- 1] :
                maxH[B- 1] = copy.copy(H[B- 1])
    
    result = 0
    for itr in range(N):
        if H[itr] == maxH[itr] or maxH[itr] == 0:
            result += 1
    #print(maxH)
    print(result)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    edges = np.zeros((N, N))
        
    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A - 1] >= H[B- 1] :
            edges[A - 1][B- 1] = H[A- 1]
            edges[B - 1][A- 1] = H[B- 1]
        else :
            edges[A - 1][B- 1] = H[B- 1]
            edges[B - 1][A- 1] = H[A- 1]
    
    result = 0
    for itr in range(N):
        count = 1
        for inner_itr in range(N):
            if edges[itr][inner_itr] >= H[itr] :
                count = 0
                break
        result += count
    
    print(result)

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
import copy

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    maxH  = np.zeros(N)

    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A- 1] == H[B- 1] :
            maxH[A- 1] = copy.copy(H[A- 1]) + 1
            maxH[B- 1] = copy.copy(H[A- 1]) + 1
        elif H[A- 1] > H[B- 1] :
            if maxH[A- 1] < H[A- 1] :
                maxH[A- 1] = copy.copy(H[A- 1])
            if maxH[B- 1] < H[A- 1] :
                maxH[B- 1] = copy.copy(H[A- 1])
        elif H[A- 1] < H[B- 1] :
            if maxH[A- 1] < H[B- 1] :
                maxH[A- 1] = copy.copy(H[B- 1])
            if maxH[B- 1] < H[B- 1] :
                maxH[B- 1] = copy.copy(H[B- 1])
    
    result = 0
    for itr in range(N):
        if H[itr] == maxH[itr] or maxH[itr] == 0:
            result += 1
    #print(maxH)
    print(result)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main() :
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    LEFT  = 0
    RIGHT = 1
    pairs = []

    for itr in range(M) :
        pairs.append(list(map(int, input().split())))

    
    resurt = 0
    for itr in range(N) :
        checkl = []
        for inner_itr in range(N) :
            checkl.append(False)
        
        count = 1
        for inner_itr in range(M) :
            if pairs[inner_itr][LEFT] == (itr + 1) :
                if H[itr] <= H[pairs[inner_itr][RIGHT] - 1] :
                    count = 0
                    break
                checkl[RIGHT - 1] = True                    

            if pairs[inner_itr][RIGHT] == (itr + 1) :
                if H[itr] <= H[pairs[inner_itr][LEFT] - 1] :
                    count = 0
                    break
                checkl[LEFT - 1] = True
        resurt += count
        checkl = None
    
    print(resurt)

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
import copy

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    maxH  = np.zeros(N)

    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A- 1] == H[B- 1] :
            maxH[A- 1] = copy.copy(H[A- 1]) + 1
            maxH[B- 1] = copy.copy(H[A- 1]) + 1
        elif H[A- 1] > H[B- 1] :
            if maxH[A- 1] < H[A- 1] :
                maxH[A- 1] = copy.copy(H[A- 1])
            if maxH[B- 1] < H[A- 1] :
                maxH[B- 1] = copy.copy(H[A- 1])
        elif H[A- 1] < H[B- 1] :
            if maxH[A- 1] < H[B- 1] :
                maxH[A- 1] = copy.copy(H[B- 1])
            if maxH[B- 1] < H[B- 1] :
                maxH[B- 1] = copy.copy(H[B- 1])
    
    result = 0
    for itr in range(N):
        if H[itr] == maxH[itr] or maxH[itr] == 0:
            result += 1
    #print(maxH)
    print(result)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main() :
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    LEFT  = 0
    RIGHT = 1
    pairs = []

    for itr in range(M) :
        pairs.append(list(map(int, input().split())))

    
    resurt = 0
    for itr in range(N) :
        checkl = []
        for inner_itr in range(N) :
            checkl.append(False)
        
        count = 1
        for inner_itr in range(M) :
            if pairs[inner_itr][LEFT] == (itr + 1) :
                if H[itr] <= H[pairs[inner_itr][RIGHT] - 1] :
                    count = 0
                    break
                elif H[itr] == H[pairs[inner_itr][RIGHT] - 1] :
                    if checkl[RIGHT - 1] == False :
                        count += 1
                        checkl[RIGHT - 1] = True                    

            if pairs[inner_itr][RIGHT] == (itr + 1) :
                if H[itr] <= H[pairs[inner_itr][LEFT] - 1] :
                    count = 0
                    break
                elif H[itr] == H[pairs[inner_itr][LEFT] - 1] :
                    if checkl[LEFT - 1] == False :
                        count += 1
                        checkl[LEFT - 1] = True
        resurt += count
        checkl = None
    
    print(resurt)

if __name__ == "__main__":
    main()

Fixed submission:
import numpy as np
import copy

def main():
    N, M  = list(map(int, input().split()))
    H     = list(map(int, input().split()))
    maxH  = np.zeros(N)

    for itr in range(M):
        A, B = list(map(int, input().split()))
        if H[A- 1] == H[B- 1] :
            maxH[A- 1] = copy.copy(H[A- 1]) + 1
            maxH[B- 1] = copy.copy(H[A- 1]) + 1
        elif H[A- 1] > H[B- 1] :
            if maxH[A- 1] < H[A- 1] :
                maxH[A- 1] = copy.copy(H[A- 1])
            if maxH[B- 1] < H[A- 1] :
                maxH[B- 1] = copy.copy(H[A- 1])
        elif H[A- 1] < H[B- 1] :
            if maxH[A- 1] < H[B- 1] :
                maxH[A- 1] = copy.copy(H[B- 1])
            if maxH[B- 1] < H[B- 1] :
                maxH[B- 1] = copy.copy(H[B- 1])
    
    result = 0
    for itr in range(N):
        if H[itr] == maxH[itr] or maxH[itr] == 0:
            result += 1
    #print(maxH)
    print(result)

if __name__ == "__main__":
    main()