Language: C++

#include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

Int mod_pow(Int x, Int n) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % MOD; //ビット演算(最下位ビットが1のとき)
        x = (x * x) % MOD;
        n >>= 1; //右シフト(n = n >> 1)
    }
    return res;
}

vector<Int> OutDivisor(Int n) {
    vector<Int> ret;
    for(Int i=1; i*i<=n; i++) {
        if(n % i == 0) {
            ret.push_back(i);
            if(i*i!=n) ret.push_back(n / i);
        }
    }
    return ret;
}

Int x[105];
Int y[105];
Int h[105];
map<int, int> memo;
map<int, int> memo2;

void output(Int X, Int Y, Int H){
    cout << X << " " << Y << " " << H << endl;
    exit(0);
}

int main(){
    int N;
    cin >> N;
    for (int i = 0; i < N; i++){
        cin >> x[i] >> y[i] >> h[i];
    }
    for (Int i = 0; i <= 100; i++){
        for (Int j = 0; j <= 100; j++){
            int flag = 1;
            Int H;
            for (int k = 0; k < N; k++){
                Int manh = abs(i-x[k]) + abs(j-y[k]);
                H = h[k] + manh;
                if (memo.find(h[k]) == memo.end()) memo[h[k]] = manh;
                else if (memo[h[k]] != manh) flag = 0;

                if (memo2.find(manh) == memo2.end()) memo2[manh] = h[k];
                else if (memo2[manh] != h[k]) flag = 0;
            }
            if (H < 1) flag = 0;
            for (int k = 0; k < N; k++){
                if (max(H - abs(i - x[k]) - abs(j - y[k]), 0) != h[k]) flag = 0;
            }
            if (flag == 1){
                output(i, j, H);
            } 
            memo.clear();
            memo2.clear();
        }
    }
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:85:24: error: no matching function for call to 'max(Int, int)'
   85 |                 if (max(H - abs(i - x[k]) - abs(j - y[k]), 0) != h[k]) flag = 0;
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:85:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   85 |                 if (max(H - abs(i - x[k]) - abs(j - y[k]), 0) != h[k]) flag = 0;
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:10:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:85:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   85 |                 if (max(H - abs(i - x[k]) - abs(j - y[k]), 0) != h[k]) flag = 0;
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~