Buggy python submission (verdict: Time Limit Exceeded):
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#展望台リスト初期化
road=[l for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    #道行列を入力
    if a-1 in road :
        if (H[b-1]>=H[a-1]):
            road.remove(a-1)
    if b-1 in road:
        if (H[a-1]>=H[b-1]):
            road.remove(b-1)

result=len(road)

print(result)

Fixed submission:
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#隣接展望台の最大標高リスト初期化
road_max=[0 for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    if road_max[a-1]<H[b-1]:
        road_max[a-1]=H[b-1]
    if road_max[b-1]<H[a-1]:
        road_max[b-1]=H[a-1]

result=[(road_max[p]<H[p])*1 for p in range(N)]

print(sum(result))

Buggy python submission (verdict: Time Limit Exceeded):
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#展望台リスト初期化
road=[l for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    #道行列を入力
    if (H[b-1]>=H[a-1]) and a-1 in road :
        road.remove(a-1)
    if (H[a-1]>=H[b-1]) and b-1 in road:
        road.remove(b-1)

result=len(road)

print(result)

Fixed submission:
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#隣接展望台の最大標高リスト初期化
road_max=[0 for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    if road_max[a-1]<H[b-1]:
        road_max[a-1]=H[b-1]
    if road_max[b-1]<H[a-1]:
        road_max[b-1]=H[a-1]

result=[(road_max[p]<H[p])*1 for p in range(N)]

print(sum(result))

Buggy python submission (verdict: Time Limit Exceeded):
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#道の行列初期化
road=[[0]*N for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    #道行列を入力
    road[a-1][b-1]=(H[b-1]>=H[a-1])*1
    road[b-1][a-1]=(H[a-1]>=H[b-1])*1

result=0

for j in range(N):
    s=sum(road[j])
    if s==0:
        result +=1

print(result)

Fixed submission:
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#隣接展望台の最大標高リスト初期化
road_max=[0 for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    if road_max[a-1]<H[b-1]:
        road_max[a-1]=H[b-1]
    if road_max[b-1]<H[a-1]:
        road_max[b-1]=H[a-1]

result=[(road_max[p]<H[p])*1 for p in range(N)]

print(sum(result))

Buggy python submission (verdict: Time Limit Exceeded):
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#道の行列初期化
road=[[0]*N for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    #道行列を入力
    road[a-1][b-1]=H[b-1]
    road[b-1][a-1]=H[a-1]

result=0

for j in range(N):
    result += (H[j]>max(road[j]))*1

print(result)

Fixed submission:
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#隣接展望台の最大標高リスト初期化
road_max=[0 for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    if road_max[a-1]<H[b-1]:
        road_max[a-1]=H[b-1]
    if road_max[b-1]<H[a-1]:
        road_max[b-1]=H[a-1]

result=[(road_max[p]<H[p])*1 for p in range(N)]

print(sum(result))

Buggy python submission (verdict: Time Limit Exceeded):
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#道の行列初期化
road=[[0]*N for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    #道行列を入力
    road[a-1][b-1]=H[b-1]
    road[b-1][a-1]=H[a-1]

result=0

for j in range(N):
    saidai=max(road[j])
    if H[j]>saidai:
        result +=1

print(result)

Fixed submission:
#入力
N,M=map(int,input().split())
H=list(map(int,input().split()))

#隣接展望台の最大標高リスト初期化
road_max=[0 for l in range(N)]

for i in range(M):
    a,b=map(int,input().split())
    if road_max[a-1]<H[b-1]:
        road_max[a-1]=H[b-1]
    if road_max[b-1]<H[a-1]:
        road_max[b-1]=H[a-1]

result=[(road_max[p]<H[p])*1 for p in range(N)]

print(sum(result))