Language: C++

#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,int>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}

int h,w;
vector<string>field(h);
bool seen[100][100];
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};
int cnt = 0;

int dfs(int y,int x,int &cnt){
    cnt++;
    seen[y][x] = true;
    rep(i,4){
        int ny = y+dy[i],nx = x+dx[i];
        if(ny<0 || ny>=h || nx<0 || nx>=w)continue;
        if(field[ny][nx] != '#')continue;
        if(seen[ny][nx])continue;
        cnt++;
        dfs(ny,nx,cnt);
    }
    return cnt;
}

int main(){
    int n;cin>>n;
    vector<P>p;
    vector<int>h(n);
    rep(i,n){
        int x,y;cin>>x>>y>>h[i];
        p.emplace_back(x,y);
    }
    rep(i,101){
        rep(j,101){
            bool f = true;
            ll ch = h[0]+abs(p[0].first-i)+abs(p[0].second-j);
            if(ch<=0)continue;
            rep(k,n){
                if(h[k] != max(ch-abs(p[k].first-i)-abs(p[k].second-j),0)){
                    f = false;
                    break;
                }
            }
            if(f)cout<<i<<" "<<j<<" "<<ch<<endl;
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:74:31: error: no matching function for call to 'max(ll, int)'
   74 |                 if(h[k] != max(ch-abs(p[k].first-i)-abs(p[k].second-j),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:74:31: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   74 |                 if(h[k] != max(ch-abs(p[k].first-i)-abs(p[k].second-j),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:7:
/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:74:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   74 |                 if(h[k] != max(ch-abs(p[k].first-i)-abs(p[k].second-j),0)){
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~