Problem p02689 (python)

Fixed submission:
import numpy as np
n,m = map(int,input().split())
h = list(map(int,input().split()))

base = np.ones(n)

for i in range(m):
  a,b =  map(int,input().split())
  if h[a-1] > h[b-1]:
    base[b-1] = 0
  elif h[a-1] < h[b-1]:
    base[a-1] = 0
  elif h[a-1] == h[b-1]:
    base[a-1] = 0
    base[b-1] = 0
    
print(int(np.sum(base)))

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

seen = np.zeros((n,n))

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1,b-1] = 1
  seen[b-1,a-1] = 1
  
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))
n = int(n)
m = int(m)
#base = np.zeros(n)
seen = np.zeros((n,n))

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1,b-1] = 1
  seen[b-1,a-1] = 1
  
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

#base = np.zeros(n)
seen = np.zeros((n,n))

#for i in range(m):
#  a,b = map(int,input().split())
#  seen[a-1,b-1] = 1
#  seen[b-1,a-1] = 1
  
ans = 0
#for i in range(n):
#  temp = np.multiply(seen[i],h)
#  temp_1 = np.max(temp)
#  if (h[i] > temp_1) and (temp_1 != 0):
#    ans += 1
#  elif temp_1 == 0:
#    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = np.array(list(map(int,input().split())))

base = np.zeros(n)
seen = np.zeros((n,n))

#for i in range(m):
#  a,b = map(int,input().split())
#  seen[a-1,b-1] = 1
#  seen[b-1,a-1] = 1
  
ans = 0
#for i in range(n):
#  temp = np.multiply(seen[i],h)
#  temp_1 = np.max(temp)
#  if (h[i] > temp_1) and (temp_1 != 0):
#    ans += 1
#  elif temp_1 == 0:
#    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = np.array(list(map(int,input().split())))

#base = np.zeros(n)
seen = np.zeros((n,n))

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1,b-1] = 1
  seen[b-1,a-1] = 1
  
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

#base = np.zeros(n)
seen = np.zeros((n,n))
temp = 1

#for i in range(m):
#  a,b = map(int,input().split())
#  seen[a-1,b-1] = 1
#  seen[b-1,a-1] = 1
  
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

#base = np.zeros(n)
seen = np.zeros((n,n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1,b-1] = 1
  seen[b-1,a-1] = 1
  
ans = 0
#for i in range(n):
#  temp = np.multiply(seen[i],h)
#  temp_1 = np.max(temp)
#  if (h[i] > temp_1) and (temp_1 != 0):
#    ans += 1
#  elif temp_1 == 0:
#    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

#base = np.zeros(n)
seen = np.zeros((n,n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1,b-1] = 1
  seen[b-1,a-1] = 1
  
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

#base = np.zeros(n)
seen = np.diag(np.ones(n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1] += seen[b-1]
  seen[b-1] += seen[a-1]
  
seen = np.where(seen > 0,1,0) - np.diag(np.ones(n))
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if (h[i] > temp_1) and (temp_1 != 0):
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

base = np.zeros(n)
seen = np.diag(np.ones(n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1] += seen[b-1]
  seen[b-1] += seen[a-1]
  
seen = np.where(seen > 0,1,0) - np.diag(np.ones(n))
ans = 0
for i in range(n):
  temp = np.multiply(seen[i],h)
  temp_1 = np.max(temp)
  if h[i] > temp_1:
    ans += 1
  elif temp_1 == 0:
    ans += 1
    
print(ans)

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

n,m = map(int,input().split())
h = list(map(int,input().split()))

base = np.zeros(n)
seen = np.diag(np.ones(n))
temp = 1

for i in range(m):
  a,b = map(int,input().split())
  seen[a-1] += seen[b-1]
  seen[b-1] += seen[a-1]
  
seen = np.where(seen > 0,1,0) - np.diag(np.ones(n))
ans = 0
for i in range(n):
  temp = seen[i]*h
  temp_1 = np.max(temp)
  if h[i] > temp_1:
    ans += 1
    
print(ans)