Buggy python submission (verdict: Time Limit Exceeded):
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    a=[]
    a=[tuple(map(int,input().split())) for i in range(m)]
    for i in range(1,n+1):
        xx=[]
        for j in set(a):
            if i == j[0]:
                xx=appen(xx,h[j[1]-1])
            if i == j[1]:
                xx=appen(xx,h[j[0]-1])
        if len(xx)==0:
            res+=1
        elif ma(xx)<h[i-1]:
            res+=1
        else:
            continue
    print(res)

if __name__ == '__main__':
    main()

Fixed submission:
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    a=[]
    b=[]
    for i in range(m):
        al,bl=map(int,input().split())
        a=appen(a,al)
        b=appen(b,bl)
    res=0
    for i in range(1,n+1):
        xx=[]
        for j in range(m):
            if i==a[j]:
                xx=appen(xx,h[b[j]-1])
            if i==b[j]:
                xx=appen(xx,h[a[j]-1])
        if len(xx)==0:
            res+=1
        elif ma(xx)<h[i-1]:
            res+=1
        else:
            continue
    print(res)
    

if __name__ == '__main__':
    main()

Fixed submission:
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    a=[]
    b=[]
    for i in range(m):
        al,bl=map(int,input().split())
        a=appen(a,al)
        b=appen(b,bl)
    res=0
    for i in range(1,n+1):
        xx=[]
        for j in range(m):
            if i==a[j]:
                xx=appen(xx,h[b[j]-1])
            if i==b[j]:
                xx=appen(xx,h[a[j]-1])
        if len(xx)==0:
            res+=1
        elif max(xx)<h[i-1]:
            res+=1
        else:
            continue
    print(res)
    

if __name__ == '__main__':
    main()

Fixed submission:
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    a=[]
    b=[]
    for i in range(m):
        al,bl=map(int,input().split())
        a=appen(a,al)
        b=appen(b,bl)
    res=0
    for i in range(1,n+1):
        xx=[]
        for j in range(m):
            if i==a[j]:
                xx=appen(xx,h[b[j]-1])
            if i==b[j]:
                xx=appen(xx,h[a[j]-1])
        if len(xx)==0:
            res+=1
        elif max(xx)<h[i-1]:
            res+=1
        else:
            continue
    print(res)
    

if __name__ == '__main__':
    main()

Fixed submission:
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
h=list(map(int,input().split()))
a=[]
b=[]
for i in range(m):
    al,bl=map(int,input().split())
    a.append(al)
    b.append(bl)
res=0
for i in range(1,n+1):
    xx=[]
    for j in range(m):
        if i==a[j]:
            xx.append(h[b[j]-1])
        if i==b[j]:
            xx.append(h[a[j]-1])

    if len(xx)==0:
        res+=1
    elif max(xx)<h[i-1]:
        res+=1
    else:
        continue
        
print(res)

Fixed submission:
def ma(li):
    # ループごとにifで大小比較
    max_num = 0
    for i in li:
        if max_num < i:
            max_num = i
    return max_num

def appen(li,yousa):
    li.append(yousa)
    return li
    
def main():
    res=0
    n,m=map(int,input().split())
    h=list(map(int,input().split()))
    
    a=[list(map(int,input().split())) for i in range(m)]
    f=[]
    for i in range(n):
        f.append([0])
    for i in a:
        f[i[0]-1].append(h[i[1]-1])
        f[i[1]-1].append(h[i[0]-1])
    p=-1
    for i in f:
        p+=1
        if len(i)==1:
            res+=1
        elif ma(i)<h[p]:
            res+=1
        else:
            continue

    print(res)

if __name__ == '__main__':
    main()