criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;
#define int long long
#define double long double
int gcd(int x, int y){
    if (y == 0)
        return x;
    x = x % y;
    gcd(y, x);
}
int keta(int n) return to_string(n).length();

main(){
    int n;
    cin >> n;
    vector<int> a(n), b(n), h(n);
    rep(i, n) cin >> a[i] >> b[i] >> h[i];
    rep(y,101){
        rep(x,101){
            int check = -1;
            rep(i,n){
                if(h[i]>0){
                int high = abs(a[i] - x) + abs(b[i] - y) + h[i];
                if (check == -1) check = high;
                else{
                    if (check != high){
                        check = -2;
                        break;
                    }
                }
                }else{
                        int check2 = abs(a[i] - x) + abs(b[i] - y);
                        if (check2 < check){
                            check = -2;
                            break;
                        }
                    }
            }
                if (check == -2) continue;
                cout << x << " " << y << " " << check << endl;
                return 0;
        }
    }
}

Compiler output:
a.cc: In function 'long long int keta(long long int)':
a.cc:12:17: error: named return values are no longer supported
   12 | int keta(int n) return to_string(n).length();
      |                 ^~~~~~
a.cc:15:9: error: declaration of 'long long int n' shadows a parameter
   15 |     int n;
      |         ^
a.cc:12:14: note: 'long long int n' previously declared here
   12 | int keta(int n) return to_string(n).length();
      |              ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:10:8: warning: control reaches end of non-void function [-Wreturn-type]
   10 |     gcd(y, x);
      |     ~~~^~~~~~
a.cc: In function 'long long int keta(long long int)':
a.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
#define int long long
#define double long double
using namespace std;
main()
{
  int n;
  cin >> n;
  vector<int> x(n),y(n),h(n);
  rep(i, n) cin >> x[i] >> y[i] >> h[i];
  rep(cx, 101){
    rep(cy, 101){
      int tmpH;
      bool flag = true;
      REP(i, n){
	  if(h[i] > 0){
	  tmpH = abs(x[i] - cx) + abs(y[i] - cy) + h[i]; 
	  break;
	}
      }
      REP(i, n){
	int test = max(tmpH -  abs(x[i] - cx) - abs(y[i] - cy), 0);
	if(test != h[i]){
	  flag = false;
	  break;
	}
      }
      if(flag){
	ansCx = cx;
	ansCy = cy;
	ansH = tmpH;
	cout << cx << " " << cy << " " << ansH << endl;
	return 0;
      }
    }
  }
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:17:11: error: 'i' was not declared in this scope
   17 |       REP(i, n){
      |           ^
a.cc:17:7: error: 'REP' was not declared in this scope
   17 |       REP(i, n){
      |       ^~~
a.cc:31:9: error: 'ansCx' was not declared in this scope
   31 |         ansCx = cx;
      |         ^~~~~
a.cc:32:9: error: 'ansCy' was not declared in this scope
   32 |         ansCy = cy;
      |         ^~~~~
a.cc:33:9: error: 'ansH' was not declared in this scope
   33 |         ansH = tmpH;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 100;
int grid[N+1][N+1];


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	memset(grid, 0, sizeof(grid));
	int n; cin >> n;
	
	int cx, cy, realH;
	for (int i = 0; i < n; i++){
		int x,y,h; cin >> x >> y >> h;	
		grid[x][y] = h;
	}
	vector<pair<int,pair<int,int>>> ans;

	for (int i = 0; i < N+1; i++){
		for (int j = 0; j < N+1; j++){
			int fakeH = 0;
			int valid = true;
			for (int x = 0; x < N+1; x++){
				for (int y = 0; y < N+1; y++){
					if (grid[x][y]){
						if (fakeH != 0){
							if (max(fakeH-abs(x-i)-abs(y-j),0) != grid[x][y]){
								valid = false;
								break;
							}
						}
						else{
							fakeH = grid[x][y] + abs(x-i) + abs(y-j);
						}
					}
				}
				if (!valid) break;
			}
			if (valid){
				found = true;
				ans.push_back(make_pair(fakeH,make_pair(i,j)));
			}
		}
	}
	
	auto p = *min_element(ans.begin(),ans.end());
	
	cout << p.second.first << " " << p.second.second << " " << p.first << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: 'found' was not declared in this scope; did you mean 'round'?
   47 |                                 found = true;
      |                                 ^~~~~
      |                                 round
Language: C++

n = int(input())
x = []
y = []
h = []
for i in range(n):
  xyh = [int(x) for x in input().split()]
  x.append(xyh[0])
  y.append(xyh[1])
  h.append(xyh[2])
maxx = x[h.index(max(h))]
maxy = y[h.index(max(h))]
maxh = max(h)
i=0
while i<len(h):
  j=i+1
  while j<len(h):
    if h[i]==h[j]:
      if y[i]==y[j]:
        maxy = (y[i]+y[j])/2
        maxh = y[i]+(j-i)/2
      if x[i]==x[j]:
        maxx = (x[i]+x[j])/2
        maxh = y[i]+(j-i)/2
    j+=1
  i+=1
print(str(maxx)+ ' ' + str(maxy) + ' ' + str(max(h)))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<int> &q){queue<int> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define rep(i,n) for(int i=0;i<(n);i++)

int main(){
    int N,l;
    cin>>N;
    vector<pair<int,int> > XY(N);
    vector<int> H(N);
    rep(i,N){
        int a,b;
        cin>>a>>b>>H[i];
        XY[i]=make_pair(a,b);
    }
    queue<int> P;//高さ保存用
    rep(i,101){
        rep(j,101){
            bool ok=true;
            clear(P);
            rep(k,N){
                if(H[k]==0)continue;
                l=H[k]+abs(XY[k].first-i)+abs(XY[k].second-j);
                if(P.empty()) P.push(l);
                else if(P.front()!=l){
                    ok=false;
                    break;
                }
            if(ok){
                cout<<i<<" "<<j<<" "<<l<<endl;
                return 0;
            }
        }
    }
    return 0;
}

//a=97,z=122

Compiler output:
a.cc: In function 'int main()':
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:19:11: note: to match this '{'
   19 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int xx,yy;
  int x[n];
  int y[n];
  long h[n];
  int j,k;
  long i;
  int tmpX,tmpY;
  long tmpH;
  int chk;
  for(i=0;i<n;i++){
    cin >> x[i] >> y[i] >> h[i];
  }

  for(i=h[0];i<=h[0]+200;i++){
    for(xx=0;xx<=100;xx++){
      for(yy=0;yy<=100;yy++){
        chk = 1;
        for(j=0;j<n;j++){
          if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
            chk = 0;
            break;
          }
        }
        if(chk == 1){
          tmpX = xx;
          tmpY = yy;
          tmpH = i;
          goto End;
        }
      }
    }
  }

End:
cout << tmpX << " " << tmpY << " " << tmpH;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: no matching function for call to 'max(int, long int)'
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:24:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:24:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int xx,yy;
  int x[n];
  int y[n];
  long h[n];
  int j,k;
  long i;
  int tmpX,tmpY;
  long tmpH;
  int chk;
  for(i=0;i<n;i++){
    cin >> x[i] >> y[i] >> h[i];
  }

  for(i=h[0];i<=h[0]+200;i++){
    for(xx=0;xx<=100;xx++){
      for(yy=0;yy<=100;yy++){
        chk = 1;
        for(j=0;j<n;j++){
          if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
            chk = 0;
            break;
          }
        }
        if(chk == 1){
          tmpX = xx;
          tmpY = yy;
          tmpH = i;
          goto End;
        }
      }
    }
  }

End:
cout << tmpX << " " << tmpY << " " << tmpH;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: no matching function for call to 'max(int, long int)'
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:24:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:24:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |           if(max(0,i-abs(x[j]-xx)-abs(y[j]-yy)) != h[i]){
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(), (v).end()
#define REP(i, p, n) for (int i = p; i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int, int> P;
using ll = long long;
using VI = vector<int>;
int main(){
    int n;cin >> n;
    vector<int> x(n),y(n),h(n);
    rep(i,n){
        cin >> x[i] >> y[i] >> h[i];
    }
    for(int cx=0;cx<=100;cx++){
        for(int cy=0;cy<=100;cy++){
            int h=-1;
            int hmax = 2e9;
            bool success = true;
            for(int i=0;i<n;i++){
                int d = abs(cx-x[i])+abs(cy-y[i]);
                if(h[i]>0){
                    int h2 = h[i]+d;
                    if(h>0&&h!=h2){
                        success = false;
                        break;
                    }else{
                        h =h2;
                    }else{
                        hmax = min(hmax,d);
                    }
                }
            }
            if(success && h<=hmax){
                cout << cx << " " << cy << " " << h << endl;
            }
        }
    }
        
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: invalid types 'int[int]' for array subscript
   26 |                 if(h[i]>0){
      |                     ^
a.cc:27:31: error: invalid types 'int[int]' for array subscript
   27 |                     int h2 = h[i]+d;
      |                               ^
a.cc:33:22: error: expected '}' before 'else'
   33 |                     }else{
      |                      ^~~~
a.cc:26:27: note: to match this '{'
   26 |                 if(h[i]>0){
      |                           ^
a.cc:38:16: error: 'success' was not declared in this scope; did you mean 'eaccess'?
   38 |             if(success && h<=hmax){
      |                ^~~~~~~
      |                eaccess
a.cc:38:30: error: 'hmax' was not declared in this scope; did you mean 'fmax'?
   38 |             if(success && h<=hmax){
      |                              ^~~~
      |                              fmax
a.cc:39:38: error: 'cy' was not declared in this scope; did you mean 'cx'?
   39 |                 cout << cx << " " << cy << " " << h << endl;
      |                                      ^~
      |                                      cx
a.cc: At global scope:
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(), (v).end()
#define REP(i, p, n) for (int i = p; i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int, int> P;
using ll = long long;
using VI = vector<int>;
int main(){
    int n;
    vector<int> x(n),y(n),h(n);
    rep(i,n){
        cin >> x[i] >> y[i] >> h[i];
    }
    for(int cx=0;cx<=100;cx++){
        for(int cy=0;cy<=100;cy++){
            int h=-1;
            int hmax = 2e9;
            bool success = true;
            for(int i=0;i<n;i++){
                int d = abs(cx-x[i])+abs(cy-y[i]);
                if(h[i]>0){
                    int h2 = h[i]+d;
                    if(h>0&&h!=h2){
                        success = false;
                        break;
                    }else{
                        h =h2;
                    }else{
                        hmax = min(hmax,d);
                    }
                }
            }
            if(success && h<=hmax){
                cout << cx << " " << cy << " " << h << endl;
            }
        }
    }
        
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: invalid types 'int[int]' for array subscript
   26 |                 if(h[i]>0){
      |                     ^
a.cc:27:31: error: invalid types 'int[int]' for array subscript
   27 |                     int h2 = h[i]+d;
      |                               ^
a.cc:33:22: error: expected '}' before 'else'
   33 |                     }else{
      |                      ^~~~
a.cc:26:27: note: to match this '{'
   26 |                 if(h[i]>0){
      |                           ^
a.cc:38:16: error: 'success' was not declared in this scope; did you mean 'eaccess'?
   38 |             if(success && h<=hmax){
      |                ^~~~~~~
      |                eaccess
a.cc:38:30: error: 'hmax' was not declared in this scope; did you mean 'fmax'?
   38 |             if(success && h<=hmax){
      |                              ^~~~
      |                              fmax
a.cc:39:38: error: 'cy' was not declared in this scope; did you mean 'cx'?
   39 |                 cout << cx << " " << cy << " " << h << endl;
      |                                      ^~
      |                                      cx
a.cc: At global scope:
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  
 int a;
cin >>a;
  
long long int x[110],y[110],h[110];

  
for (int i=0;i<a;i++){
cin >>x[i] >>y[i] >> h[i];
}
for (int posx=0;posx<=100;posx++){
  
      for (posy=0;posy<=100;posy++){
            for ( int nh=(h[0]-100);nh<=h[0]+100;nh++){
              
    bool abcd=true;
              
         for ( int i=0;i<a;i++){
           
long long int k=0;
if(h[i]!=max(nh-abs(posx-x[i])-abs(posy-y[i]),k)) abcd=false;
}
if (abcd==true) 
  cout <<posx <<" "<< posy <<" "<<nh <<endl;
           }
      }
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'posy' was not declared in this scope; did you mean 'posx'?
   20 |       for (posy=0;posy<=100;posy++){
      |            ^~~~
      |            posx
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int n;
  cin >> n;
  vector<int64_t> xxx(n);
  vector<int64_t> yyy(n);
  vector<int64_t> hhh(n);
  
  int a,b,c;
  for(int i = 0 ; i < n ; i++){
    cin >> xxx.at(i) >> yyy.at(i) >> hhh.at(i);
    if(hhh.at(i) >= 1){
      a = xxx.at(i);
      b = yyy.at(i);
      c = hhh.at(i);
    }
  }

  bool jad = false;
  for(int x = 0 ; x <= 100 ; x++){
    for(int y = 0 ; y <= 100 ; y++){
      
      int64_t h = abs(x-a)+abs(y-b)+c;
      for(int i = 1 ; i < n ; i++){
        
        if( max( h-abs(x-xxx.at(i))-abs(y-yyy.at(i)) , 0) != hhh.at(i)){
          break;
        }
        if(i == n-1){
          cout << x << " " << y << " " << h << endl;
          jad = true;
          break;
        }
      }
      if(jad){
        break;
      }
    }
    if(jad){
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: no matching function for call to 'max(int64_t, int)'
   28 |         if( max( h-abs(x-xxx.at(i))-abs(y-yyy.at(i)) , 0) != hhh.at(i)){
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:28:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   28 |         if( max( h-abs(x-xxx.at(i))-abs(y-yyy.at(i)) , 0) != hhh.at(i)){
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:28:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   28 |         if( max( h-abs(x-xxx.at(i))-abs(y-yyy.at(i)) , 0) != hhh.at(i)){
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>

struct Point{
  int x;
  int y;
  int h;
};

bool operator< (const Point &p0, const Point &p1){
  return p0.h < p1.h;
}

Point explore(std::vector<Point> points){
  int n = (int)points.size();
  sort(points.begin(), points.end());
  
  Point center;
  
  int o_x = points.at(n - 1).x;
  int o_y = points.at(n - 1).y;
  int o_h = points.at(n - 1).h;
  
  bool yet = true;
  for(int x = 0; x <= 100 && yet; x++){
    for(int y = 0; y <= 100; y++){
      int h = o_h + abs(x - o_x) + abs(y - o_y);
      bool is_center = true;
      
      for(int i = 0; i < n - 1; i++){
        if(points.at(i).h != max(h - abs(x - points.at(i).x) - abs(y - points.at(i).y), 0)){
          is_center = false;
          break;
        }
      }
      
      if(is_center){
        center = {x, y, h};
        yet = false;
        break;
      }
    }
  }
  
  return center;
}

int main(){
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  
  int n;
  std::cin >> n;
  
  std::vector<Point> observation_points(n);
  
  for(int i = 0; i < n; i++){
    int x, y, h;
    std::cin >> x >> y >> h;
    
    observation_points.at(i).x = x;
    observation_points.at(i).y = y;
    observation_points.at(i).h = h;
  }
  
  Point center = explore(observation_points);
  std::cout << center.x << ' ' << center.y << ' ' << center.h << std::endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'Point explore(std::vector<Point>)':
a.cc:32:30: error: 'max' was not declared in this scope; did you mean 'std::max'?
   32 |         if(points.at(i).h != max(h - abs(x - points.at(i).x) - abs(y - points.at(i).y), 0)){
      |                              ^~~
      |                              std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ft first
#define sd second
#define pb push_back
using ll = long long;
const int INF = 1e9+7;
const int EPS = -1e6;
inline void fastio() {ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);}
const int maxn = 100000+5;

int n;
pair<int, int> co[120];
ll ht[120];

int main(){
    //freopen("input.txt", "r", stdin);
    fastio();

    cin>>n;
    int si = -1;
    for(int i = 0; i < n; ++i){
        int x,y;
        ll h;
        cin>>x>>y>>h;
        co[i] = make_pair(x,y);
        ht[i] = h;
        if(h[i] > 0) si = i;
    }

    for(int cx = 0; cx <= 100; ++cx){
        for(int cy = 0; cy <= 100; ++cy){
            int flag = 1;

            ll H = ht[si] + abs(co[si].ft - cx) + abs(co[si].sd - cy);

            for(int i = 0; i < n; ++i){
                if(ht[i] > 0 && H != ht[i] + abs(co[i].ft - cx) + abs(co[i].sd - cy))
                    flag = 0;
                if(ht[i] == 0 && H - abs(co[i].ft - cx) - abs(co[i].sd - cy) > 0)
                    flag = 0;
            }

            if(flag){
                cout<<cx<<" "<<cy<<" "<<H<<endl;
                return 0;
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: invalid types 'll {aka long long int}[int]' for array subscript
   28 |         if(h[i] > 0) si = i;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;cin>>n;
    int x[n],y[n],h[n];
    tuple<int,int,int> t;
    for (int i=0;i<n;i++) {
        cin>>x[i]>>y[i]>>h[i];
        if (h[i]!=0)
            t=make_tuple(x[i],y[i],h[i]);
    }
    for (int i=0;i<=100;i++)
        for (int j=0;j<=100;j++) {
            int a=abs(j-get<0>(t))+abs(i-get<1>(t))+get<2>(t);
            int f=1;
            for (int k=1;k<;k++)
                f&=max(0,a-abs(j-x[k])-abs(i-y[k]))==h[k];
            if (f) {
                cout<<j<<' '<<i<<' '<<a<<endl;
                return 0;
            }
        }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected primary-expression before ';' token
   18 |             for (int k=1;k<;k++)
      |                            ^
Language: C

#include<stdio.h>
#include<math.h>
int main(){
    int N;
    int a[3][100],b[100];
    int i,j,p,h_min = 0;
    scanf("%d",&N);
    for(i = 0;i < N;i++){
        scanf("%d",&a[0][i]);
        scanf("%d",&a[1][i]);
        scanf("%d",&a[2][i]);
    }
    for(i = 0;i < 100;i++){
        for(j = 0;j < 100;j++){
            for(p = 0,h_min = 0;p < N;p++){
                b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
                if(a[2][p] != 0){
                    if(b[p] <= h_min || p == 0) h_min = b[p];
                }
            }
            for(p = 0;p < N;p++){
                if(a[2][p] != 0){
                    if(b[p] != h_min) break;
                }
                else
                {
                    if(b[p] >= h_min) break;
                }
                if(p == N) h = h_min;
            }
        }
    }
    printf("%d",h);
}

Compiler output:
main.c: In function 'main':
main.c:16:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   16 |                 b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
      |                        ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main(){
main.c:29:28: error: 'h' undeclared (first use in this function)
   29 |                 if(p == N) h = h_min;
      |                            ^
main.c:29:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>
int main(){
    int N;
    int a[3][100],b[100];
    int i,j,p,h_min = 0;
    scanf('%d',&N);
    for(i = 0;i < N;i++){
        scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
    }
    for(i = 0;i < 100;i++){
        for(j = 0;j < 100;j++){
            for(p = 0,h_min = 0;p < N;p++){
                b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
                if(a[2][p] != 0){
                    if(b[p] <= h_min || p == 0) h_min = b[p];
                }
            }
            for(p = 0;p < N;p++){
                if(a[2][p] != 0){
                    if(b[p] != h_min) break;
                }
                else
                {
                    if(b[p] >= h_min) break;
                }
                if(p == N) h = h_min;
            }
        }
    }
    printf("%d",h);
}

Compiler output:
main.c: In function 'main':
main.c:7:11: warning: multi-character character constant [-Wmultichar]
    7 |     scanf('%d',&N);
      |           ^~~~
main.c:7:11: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    7 |     scanf('%d',&N);
      |           ^~~~
      |           |
      |           int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:9:15: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    9 |         scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
      |               ^~~~~~~~~~
main.c:9:15: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    9 |         scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
      |               ^~~~~~~~~~
      |               |
      |               int
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:14:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   14 |                 b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
      |                        ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main(){
main.c:27:28: error: 'h' undeclared (first use in this function)
   27 |                 if(p == N) h = h_min;
      |                            ^
main.c:27:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>
int main(){
    int N;
    int a[3][100],b[100];
    int i,j,p,h_min = 0;
    scanf('%d',&N);
    for(i = 0;i < N;i++){
        scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
    }
    for(i = 0;i < 100;i++){
        for(j = 0;j < 100;j++){
            for(p = 0,h_min = 0;p < N;p++){
                b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
                if(a[2][p] != 0){
                    if(b[p] <= h_min || p == 0) h_min = b[p];
                }
            }
            for(p = 0;p < N;p++){
                if(a[2][p] != 0){
                    if(b[p] != h_min) break;
                }
                else
                {
                    if(b[p] > h_min) break;
                }
                if(p == N) h = h_min;
            }
        }
    }
    printf("%d",h);
}

Compiler output:
main.c: In function 'main':
main.c:7:11: warning: multi-character character constant [-Wmultichar]
    7 |     scanf('%d',&N);
      |           ^~~~
main.c:7:11: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    7 |     scanf('%d',&N);
      |           ^~~~
      |           |
      |           int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:9:15: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    9 |         scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
      |               ^~~~~~~~~~
main.c:9:15: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
    9 |         scanf('%d %d %d',&a[0][i],&a[1][i],&a[2][i]);
      |               ^~~~~~~~~~
      |               |
      |               int
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:14:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   14 |                 b[p] = abs(i - a[0][p]) + abs(j - a[1][p]) + a[2][p];
      |                        ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main(){
main.c:27:28: error: 'h' undeclared (first use in this function)
   27 |                 if(p == N) h = h_min;
      |                            ^
main.c:27:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
struct infor {
	int x;
	int y;
	long h;
};
struct test {
	int Xc;
	int Yc;
	long H;
	int t;
};
test C[10201];
infor in[101], in1[101], in2[101];
int main()
{
	int N;
	int i,j=0,k=0;
	int Xc, Yc;
	cin >> N;
	for (i = 0; i < N; i++)
    	cin >> in[i].x >> in[i].y >> in[i].h;
	for (i = 0; i < N; i++)
	{
		if (in[i].h != 0)
			in1[j++] = in[i];
		else
			in2[k++] = in[i];
	}
	int m,n=0;
      for (Xc = 0; Xc <= 100; Xc++)
		{
			for (Yc = 0; Yc <= 100; Yc++)
			{
				C[n].Xc = Xc;
				C[n].Yc = Yc;
				C[n].H = in1[0].h + abs(Xc - in1[0].x) + abs(Yc - in1[0].y);
				for(m = 0; m < j - 1;m++)
				{
					if (in1[m].h + abs(Xc - in1[m].x) + abs(Yc - in1[m].y) == in1[m + 1].h + abs(Xc - in1[m + 1].x) + abs(Yc - in1[m + 1].y))
						C[n].t = 1;
					else
					{
						C[n].t = 0;
						break;
					}
				}
				n++;
			}
		}
	  for (i = 0; i < n; i++)
	  {
		  if (C[i].t == 1)
		  {
			  for (m = 0; m < k; m++)
			  {
				  if (C[i].H - abs(C[i].Xc - in2[m].x) - abs(C[i].Yc - in2[m].y) <= 0)
					  C[i].t = 1;
				  else
				  {
					  C[i].t = 0;
					  break;
				  }
			  }
		  }
		  else continue;
		  if(C[i].t == 1)
			  cout << C[i].Xc << ' '<< C[i].Yc << ' ' << C[i].H;  
	  }
	  return ;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:11: error: return-statement with no value, in function returning 'int' [-fpermissive]
   72 |           return ;
      |           ^~~~~~
Language: C++

#include <cstdio>
#include <cmath>
using namespace std;
int try1(int array[][5], int a, int b ,int len);
int all_zero (int array[][5],int a, int b, int len);
void sort(int array[][5], int len, int key);
int main()
{
    int x, y, len, H;
    int array[100][5];
    scanf("%d", &len);
    for(int iter = 0;iter < len; iter++)
    {
        scanf("%d%d%d",&array[iter][0], &array[iter][1], &array[iter][2]);
    }
    for(x = 0; x <= 100;x++)
    {
        for(y = 0; y <= 100; y++)
        {
            H = try1(array, x, y, len);
            if(H > 0)
                break;
        }
        if(y != 101)
            break;
    }
    printf("%d %d %d", x, y, H);
}
int try1(int array[][5], int a, int b ,int len)
{
    int iter, i;
    for(iter = 0; iter < len; iter ++)
    {
        if(array[iter][2] == 0)
        {
            array[iter][3] = -1;
            continue;
        }
        else
            array[iter][3] = abs(array[iter][0] - a) + abs(array[iter][1] - b) +array[iter][2];
    }
    for(iter = 0; iter < len-1;iter++)
    {
        if((array[iter][3] == -1)||(array[iter+1][3] == -1))
            continue;
        else
            if(array[iter][3]!=array[iter+1][3])
                return 0;
    }
    for(int iter = 0;iter < len; iter++)
    {
        array[iter][4] = abs(a-array[0][0])+abs(b-array[0][1]) + array[0][2];
    }
    sort(array, len , 4);
    return array[0][4];
}

Compiler output:
/usr/bin/ld: /tmp/ccunfpHI.o: in function `try1(int (*) [5], int, int, int)':
a.cc:(.text+0x394): undefined reference to `sort(int (*) [5], int, int)'
collect2: error: ld returned 1 exit status
Language: C++

//wrong answer
#include<iostream>
#include<algorithm>

using namespace std;

int abs(int m, int n)
{
	return m - n > 0 ? m - n : n - m;
}

struct data {
	int x;
	int y;
	int h;
}d[105];

int main()
{
	int N, p=0;
	cin >> N;
	for (int i = 0;i < N;i++)
	{
		cin >> d[i].x >> d[i].y >> d[i].h;
	}
	while(d[p].h==0) p++;
	for (int i = 0;i < 101;i++)
		for (int j = 0;j < 101;j++)
		{
			int H = d[node].h + abs(d[node].x, i) + abs(d[node].y, j);
			int l = 0;
			for (int k = 0;k < N;k++)
			{
				if (max(0, H - abs(d[k].x, i) - abs(d[k].y, j)) == d[k].h) l++;
			}
			//		cout<<i<<" "<<j<<" "<<H;
			//	cout<<"  *  "<<l<<"   &  "<<N<<endl;
			if (l == N) {
				cout << i << " " << j << " " << H << endl;
				return 0;
			}
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:35: error: 'node' was not declared in this scope
   30 |                         int H = d[node].h + abs(d[node].x, i) + abs(d[node].y, j);
      |                                   ^~~~
Language: C++

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long; 
using pii = pair<int,int>; 
using db = double; 
using vi = vector<int>; 
using vl = vector<ll>; 
#define fir first
#define sec second
#define pb push_back
#define lowbit(x) ((x)&(-(x))) 

const int maxn = 106; 

int n, o; 
int x[maxn], y[maxn], h[maxn];

int Abs(int x) {
	return x>0?x:-x; 
}

int D(int x1, int y1, int x2, int y2) {
	return Abs(x1-x2)+Abs(y1-y2); 
}

bool check(int X, int Y) {
	int H = D(X,Y,x[o],y[o])+h[o];
	for (int i = 1; i <= n; ++i) 
		if (max(0,H-D(X,Y,x[i],y[i])) != h[i]) return false; 
	return true; 
} 

int main() {
	cin>>n; 
	for (int i = 1; i <= n; ++i) 
		cin>>x[i]>>y[i]>>h[i]; 
	for (int i = 1; i <= n; ++i)
		if (h[i] != 0) o = i; 
	for (int X = 0; X <= 100; ++X) 
		for (int Y = 0; Y <= 100; ++Y) 
			if (check(X, Y)) {
				cout<<X<<' '<<Y<<' '<<D(X,Y,x[o],y[o])+h[o]<<endl; 
				return 0; 
			}
}


Compiler output:
a.cc:10:12: error: 'vector' does not name a type
   10 | using vi = vector<int>;
      |            ^~~~~~
a.cc:11:12: error: 'vector' does not name a type
   11 | using vl = vector<ll>;
      |            ^~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
using namespace std;

int N;
int X[110], Y[110], H[110];
bool flag;

int main(){
	cin >> N;
	for (int i = 0; i < N; i++)
		cin >> X[i] >> Y[i] >> H[i];
	flag = false;
	for (int x = 0; x <= 100 && !flag; x++)
		for (int y = 0; y <= 100 && !flag; y++){
			int h = 0;
			flag = true;
			for (int i = 0; i < N; i++)
				if (H[i] > 0){
					if (h == 0)
						h = H[i] + abs(X[i] - x) + abs(Y[i] - y);
					else if (h != H[i] + abs(X[i] - x) + abs(Y[i] - y))
						flag = false;
				}
			for (int i = 0; i < N; i++)
				if (H[i] != max(h - abs(X[i] - x) - abs(Y[i] - y)))
					flag = false;
			if (h == 0)
				flag = false;
			if (flag)
				printf("%d %d %d\n", x, y, h);
		}
	assert(flag);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:48: error: no matching function for call to 'max(int)'
   31 |                                 if (H[i] != max(h - abs(X[i] - x) - abs(Y[i] - y)))
      |                                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:2:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/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:   template argument deduction/substitution failed:
a.cc:31:48: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |                                 if (H[i] != max(h - abs(X[i] - x) - abs(Y[i] - y)))
      |                                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
const int N = 105;
struct info{
    int x, y, h;
}a[N];
template<class T> Abs(T x){
    return x < 0 ? -x : x;
}
int main(){
    int n; cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> a[i].x >> a[i].y >> a[i].h;
    for (int i = 0; i <= 100; ++i)
        for (int j = 0; j <= 100; ++j){
            int h = a[1].h + Abs(a[1].x - i) + Abs(a[1].y - j);
            bool flag = 1;
            for (int k = 2; k <= n; ++k)
                flag &= ((h - Abs(a[k].x - i) - Abs(a[k].y - j)) == a[k].h);
            if(flag)return cout << i << " " << j << " " << h << endl, 0;
        }
    return 0;
}


Compiler output:
a.cc:8:19: error: ISO C++ forbids declaration of 'Abs' with no type [-fpermissive]
    8 | template<class T> Abs(T x){
      |                   ^~~
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using tdata=pair<ll,datas>;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define endl "\n"

int main(){
  ll i,j,N,ans,x,y,d;
  cin>>N;
  vector<tdata> v(N);
  rep(i,N){
    cin>>v[i].second.first>>v[i].second
.second>>v[i].first;
  }
  rep(x,101){
    rep(y,101){
      ans=v[0].first+labs(x-v[0].second.first)+labs(y-v[0].second.second);
      j=1;
      rep1(i,N){
        d=labs(x-v[i].second.first)+labs(y-v[i].second.second);
        if(max(ans-d,0)!=v[i].first){
          j=0;
          break;
        }
      }
      if(j){
        cout<<x<<" "<<y<<" "<<ans<<endl;
        return 0;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: no matching function for call to 'max(ll, int)'
   26 |         if(max(ans-d,0)!=v[i].first){
      |            ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/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:26:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   26 |         if(max(ans-d,0)!=v[i].first){
      |            ~~~^~~~~~~~~
/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:
/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:26:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |         if(max(ans-d,0)!=v[i].first){
      |            ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int n;
  ll cx,cy,H,endf=0;
  cin >> n;
  vector<ll>x(n);
  vector<ll>y(n);
  vector<ll>h(n);
  rep(i,n) cin >> x.at(i) >> y.at(i) >> h.at(i);
  rep(i,101){
  	cx=i;
  	rep(j,101){
  		cy=j;
  		rep(k,n){
  			if(h.at(k)>=1){
  				H=h.at(k)+abs(cx-x.at(k))+(cy-y.at(k));
  				break;
  			}
  		}
  		rep(k,n){
  			if(max(H-abs(cx-x.at(k))-(cy-y.at(k)),0)!=h.at(k)) break;
  			else if(k==n-1) endf=1;
  		}		
     	if(endf==1) break;	
  	}
  	if(endf==1) break;
  }
  cout << cx << " " << cy << " " << H << endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:31: error: no matching function for call to 'max(ll, int)'
   26 |                         if(max(H-abs(cx-x.at(k))-(cy-y.at(k)),0)!=h.at(k)) break;
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:26:31: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   26 |                         if(max(H-abs(cx-x.at(k))-(cy-y.at(k)),0)!=h.at(k)) break;
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:26:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |                         if(max(H-abs(cx-x.at(k))-(cy-y.at(k)),0)!=h.at(k)) break;
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~