Problem: In the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.   The pyramid had _center coordinates_ (C_X, C_Y) and _height_ H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).  Aoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:    * C_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.    * Additionally, he obtained N pieces of information. The i-th of them is: "the altitude of point (x_i, y_i) is h_i."   This was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.

Submission attempts (in order):
import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

n, = map(int, input().split())
data = getSomeInputListInt(n)

rng = 101

def clc(i, j, h, x, y):
    return max(0, h + abs(i-x) + abs(j-y))

ansi = 0
ansj = 0

for i in range(rng):
    flgI = False
    for j in range(rng):
        flgJ = False
        for k in range(n-1):
            tmpBefore = clc(i, j, data[k][2], data[k][0], data[k][1])
            tmpAfter = clc(i, j, data[k+1][2], data[k+1][0], data[k+1][1])
            if tmpBefore != tmpAfter:
                flgJ = True
                break

        if flgJ:
            break

        if not flgJ:
            ansi = i
            ansj = j
            flgI == True
            break

    if flgI:
        break

print(ansi, ansj, clc(ansi, ansj, data[0][2], data[0][0], data[0][1]))









import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

n, = map(int, input().split())
data = getSomeInputListInt(n)

rng = 101

def clc(i, j, h, x, y):
    return h + abs(i-x) + abs(j-y)

def clcdis(i, j, x, y):
    return abs(i-x) + abs(j-y)

ansi = 0
ansj = 0
ansh = 0

flgBreakI = False

for i in range(rng):
    for j in range(rng):
        flg = True
        tmp = 0
        hmax = 10**10

        for k in range(n):
            if data[k][2] == 0:
                hmax = min(hmax, clcdis(i, j, data[k][0], data[k][1]))
            else:
                if tmp == 0:
                   tmp = clc(i, j, data[k][2], data[k][0], data[k][1])
                else:
                    if tmp != clc(i, j, data[k][2], data[k][0], data[k][1]):
                        flg = False
                        break

        if flg and tmp <= hmax:
            ansi = i
            ansj = j
            ansh = tmp
            flgBreakI = True
            break

    if flgBreakI:
        break

print(ansi, ansj, ansh)




Verdicts: Wrong Answer

Accepted