Buggy python submission (verdict: Runtime Error):
def main():
    n, d = map(int, input().split())
    x = [int(input()) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (x[j][k]-x[i][k])**2
            if (res**0.5).is_integer():
                ans += 1
    prnt(ans)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n, d = map(int, input().split())
    x = [list(map(int, input().split())) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (x[j][k]-x[i][k])**2
            if (res**0.5).is_integer():
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n, d = map(int, input().split())
    x = [int(input()) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (j[k]-i[k])**2
            if (res**0.5).is_integer():
                ans += 1
    prnt(ans)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n, d = map(int, input().split())
    x = [list(map(int, input().split())) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (x[j][k]-x[i][k])**2
            if (res**0.5).is_integer():
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    import math
    n, d = map(int, input().split())
    x = [int(input()) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (j[k]-i[k])**2
            res = math.sqrt(s)
            if res.is_integer():
                ans += 1
    prnt(ans)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n, d = map(int, input().split())
    x = [list(map(int, input().split())) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (x[j][k]-x[i][k])**2
            if (res**0.5).is_integer():
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    import math
    n, d = map(int, input().split())
    x = [int(input()) for i in range(n)]

    ans = 0
    for i in range(1,x):
        for j in range(x-1):
            res = 0
            for k in range(d):
                res += (j[k]-i[k])**2
            res = math.sqrt(s)
            if res.is_integer():
                ans += 1
    prnt(ans)

if __name__ == '__main__':
    main()



Fixed submission:
def main():
    n, d = map(int, input().split())
    x = [list(map(int, input().split())) for i in range(n)]

    ans = 0
    for i in range(n-1):
        for j in range(i+1,n):
            res = 0
            for k in range(d):
                res += (x[j][k]-x[i][k])**2
            if (res**0.5).is_integer():
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()