Buggy python submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import math
 
a = [map(int,input().split()) for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      d = math.sqrt((a[i][0] - a[j][0]) ** 2 + (a[i][1] - a[j][1]) ** 2 +(a[i][2] - a[j][2]) ** 2  +(a[i][3] - a[j][3]) ** 2  + (a[i][4] - a[j][4]) ** 2)
      d = float(d)
      if d.is_integer():
        count += 1
print(count)

Fixed submission:
n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))

Buggy python submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import math
 
a = [[int(c) for c in l.strip()] for l in sys.stdin]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      d = math.sqrt((a[i][0] - a[j][0]) ** 2 + (a[i][1] - a[j][1]) ** 2 +(a[i][2] - a[j][2]) ** 2  +(a[i][3] - a[j][3]) ** 2  + (a[i][4] - a[j][4]) ** 2)
      d = float(d)
      if d.is_integer():
        count += 1
print(count)

Fixed submission:
n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))

Buggy python submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import numpy as np
 
a = [[int(c) for c in l.strip()] for l in sys.stdin]
a_ = np.array(a)
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      u = a[i] - a[j]
      norm = numpy.linalg.norm(u)
      if norm.is_integer():
        count += 1
print(count)

Fixed submission:
n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))

Buggy python submission (verdict: Runtime Error):
n , d =map(int,input().split())
import sys
import numpy

a = [[int(c) for c in l.strip()] for l in sys.stdin]
a_ = np.array(a)
count = 0

for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      u = a[i] - a[j]
      norm = numpy.linalg.norm(u)
      if norm.is_integer():
        count += 1
print(count)


Fixed submission:
n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))