Problem p03240 (python)

Fixed submission:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

count = 0
while True:
    if xyh[count][2] > 0:
        xstd = xyh[count][0]
        ystd = xyh[count][1]
        hstd = xyh[count][2]
        break
    else:
        count += 1

for x in range (101):
    for y in range (101):
        Cx = x
        Cy = y
        H = hstd + abs(xstd-Cx) + abs (ystd - Cy)
        xyhcand = []
        for k in range (N) :
            xi = xyh[k][0]
            yi = xyh[k][1]
            h = max(H-abs(xi-Cx)-abs(yi-Cy),0)
            xyhls = [xi,yi,h]
            xyhcand.append(xyhls)
            xyhls = []
        if sorted(xyh) == sorted(xyhcand):
            ans = " ".join([str(x),str(y),str(H)])
            break
        
print(ans)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

count = 0
while True:
    if xyh[count][2] >= 0:
        hstd = xyh[count][2]
        break
    else:
        count += 1

for x in range (101):
    for y in range (101):
        Cx = x
        Cy = y
        H = hstd + abs(x-Cx) + abs (y - Cy)
        xyhcand = []
        for k in range (N) :
            xi = xyh[k][0]
            yi = xyh[k][1]
            h = max(H-abs(x-Cx)-abs(y-Cy),0)
            xyhls = [xi,yi,h]
            xyhcand.append(xyhls)
            xyhls = []
        if sorted(xyh) == sorted(xyhcand):
            ans = '.'.join([x,y,H])
            break
        
print(ans)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

count = 0
while True:
    if xyh[count][2] >= 0:
        hstd = xyh[count][2]
        break
    else:
        count += 1

for x in range (101):
    for y in range (101):
        Cx = x
        Cy = y
        H = hstd + abs(x-Cx) + abs (y - Cy)
        xyhcand = []
        for k in range (N) :
            xi = xyh[k][0]
            yi = xyh[k][1]
            h = max(H-abs(x-Cx)-abs(y-Cy),0)
            xyhls = [xi,yi,h]
            xyhcand.append(xyhls)
            xyhls = []
        if set(xyh) == set(xyhcand):
            ans = '.'.join([x,y,H])
            break
        
print(ans)

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

for Cx in range(101):
    for Cy in range (101):
        ls =[]
        for i in range (N):
            x = xyh[i][0]
            y = xyh[i][1]
            h = max(H-abs(x-Cx)-abs(y-Cy),0)
            ls.append([x,y,h])
    if set(ls) == set(xyh):
        ans = [Cx,Cy,h]
    ls = []

print(ans.split())

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

for Cx in range(101):
    for Cy in range (101):
        for i in range (N):
            ls = []
            x = xyh[i][0]
            y = xyh[i][1]
            h = max(H-abs(x-Cx)-abs(y-Cy),0)
            ls.append([x,y,h])
        
        if set(ls) == set(xyh):
            ans = [Cx,Cy,h]

print(ans.split())

Buggy submission (verdict: Runtime Error):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
xyh = []
for _ in range (N):
    xyh.append([int(x) for x in input().split()])

for Cx in range(101):
    for Cy in range (101):
        for i in range (N):
            ls = []
            x = xyh[i][0]
            y = xyh[i][1]
            h = max(H-abs(x-Cx)-abs(y-Cy),0)
            ls.append([x,y,h])
        
        if set(ls) == set(xyh)
        ans = [Cx,Cy,h]

print(ans.split())