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

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <stdio.h>
//#include <cstdlib>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue() {
  int a;
  cin >> a;
  return a;
};

void inputArray(int * p, int a) {
  rep(i, a) {
    cin >> p[i];
  }
};

void inputVector(vector<int>* v) {
  //cin.tie(0);
  //ios::sync_with_stdio(false);
  int a;
  while (cin >> a) {
    if (a == -1)break;
    v->push_back(a);
  }
};

void inputVector(vector<int> * p, int a) {
  rep(i, a) {
    int input;
    cin >> input;
    p->push_back(input);
  }
}

void inputVector2(vector<vector<int>>& v, int r, int c) {
  int temp;
  for (size_t i = 0; i < r; i++)
  {
    for (size_t j = 0; j < c; j++)
    {
      scanf_s("%d", &temp);
      v[i][j] = temp;
    }
  }
}

template <typename T>
void output(T a, int precision) {
  if (precision > 0) {
    cout << setprecision(precision) << a << "\n";
  }
  else {
    cout << a << "\n";
  }
}



int main(int argc, const char * argv[]) {
  int width = 100;
  int n = inputValue();
  auto a1 = vector<vector<int>>(n, vector<int>(3, 0));
  auto seikai = vector<int>(3, 0);
  inputVector2(a1, n, 3);
  int htemp = 0;
  bool T = true;

  for (int i = 0; i < width; i++)
  {
    for (int j = 0; j < width; i++)
    {
      T = true;
      htemp = a1[0][2] + abs(i - a1[0][0]) + abs(j - a1[0][1]);
      for (int k = 1; k < n; k++) {
        if (a1[k][2] + abs(i - a1[k][0]) + abs(j - a1[k][1]) != htemp) {
          T = false;
          break;
        }
      }
      if (T) {
        seikai[0] = i;
        seikai[1] = j;
        seikai[2] = htemp;
        goto LABEL;
      }
    }
  }
LABEL:
  printf("%d %d %d", seikai[0], seikai[1], seikai[2]);
  return 0;
}

Compiler output:
a.cc: In function 'void inputVector2(std::vector<std::vector<int> >&, int, int)':
a.cc:56:7: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   56 |       scanf_s("%d", &temp);
      |       ^~~~~~~
      |       scanf
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define ll long long
using namespace std;

int main(){
	int N;
	cin >>N;
	struct P{
		int x;
		int y;
		ll h;
	};
	P p[N];
	P sample;
	for(int i=0;i<N;i++){
		cin>>p[i].x>>p[i].y>>p[i].h;
		if(p[i].h>=1LL){
			sample=p[i];
		}
	}

	vector<P> ansPoss;
	for(int x=0;x<=100;x++){
		for(int y=0;y<=100;y++){
			bool flag=true;
			ll V=sample.h+abs(sample.x-x)+abs(sample.y-y);
			V=max(V,0);
			for(int i=0;i<N;i++){
				if(p[i].h!=V-abs(p[i].x-x)-abs(p[i].y-y)){
					flag=false;
				}
			}
			if(flag==true){
				ansPoss.push_back(P{x,y,V});
			}
		}
	}
	P ans=ansPoss[0];
	cout<<ans.x <<" "<<ans.y <<" "<<ans.h <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: no matching function for call to 'max(long long int&, int)'
   31 |                         V=max(V,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:31:30: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   31 |                         V=max(V,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:2:
/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:31:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   31 |                         V=max(V,0);
      |                           ~~~^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define ll long long
using namespace std;

int main(){
	int N;
	cin >>N;
	struct P{
		int x;
		int y;
		int h;
	};
	P p[N];
	P sample;
	for(int i=0;i<N;i++){
		cin>>p[i].x>>p[i].y>>p[i].h;
		if(h>=1){
			sample=p[i];
		}
	}

	vector<P> ansPoss;
	for(int x=0;x<=100;x++){
		for(int y=0;y<=100;y++){
			for(int i=0;i<N;i++){
				bool flag=true;
				if(sample.h-p[i].h!=-abs(sample.x-x)-abs(sample.y-y)+abs(p[i].x-x)+abs(p[i].y-y)){
					flag=false;
				}
				if(flag==true){
					ansPoss.push_back(P{x,y,})
				}
			}
		}
	}
	P ans=ansPoss[0];
	cout<<ans.x <<" "<<ans.y <<" "<<sample.h+abs(sample.x-ans.x)+abs(sample.y-ans.y) <<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'h' was not declared in this scope
   21 |                 if(h>=1){
      |                    ^
a.cc:35:67: error: expected ';' before '}' token
   35 |                                         ansPoss.push_back(P{x,y,})
      |                                                                   ^
      |                                                                   ;
   36 |                                 }
      |                                 ~
Language: C++

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

int main(){

    int N; cin >> N;
    vector<int> x(N);
    vector<int> y(N);
    vector<int> h(N);

    int H, X, Y;

    for(int i = 0; i < N; i++){
        cin >> x[i] >> y[i] >> h[i];
        if(h[i] != 0){
            H = h[i];
            X = x[i];
            Y = y[i];
        }
    }

    for(int cx = 0; cx <= 100; cx++){
        for(int cy = 0; cy <= 100; cy++){
            
            int height = H + (int)abs(cx - X[0]) + (int)abs(cy - Y[0]);
            if(height == 0) continue;
            //cout << cx << " " << cy << " " << height << endl;
            bool ok = true;
            for(int i = 0; i < N; i++){
                //if(cx == 2 && cy == 2) cout << i << " " << cx << " " << cy << " " << height << " " << max(height - (int)abs(cx - x[i]) - (int)abs(cy - y[i]), 0) << endl;
                if(h[i] != max(height - (int)abs(cx - x[i]) - (int)abs(cy - y[i]), 0)){
                    ok = false;
                    break;
                }
            }

            if(ok){
                cout << cx << " " << cy << " " << height << endl;
                return 0;
            }

        }
    }

    while(1){}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:45: error: invalid types 'int[int]' for array subscript
   25 |             int height = H + (int)abs(cx - X[0]) + (int)abs(cy - Y[0]);
      |                                             ^
a.cc:25:67: error: invalid types 'int[int]' for array subscript
   25 |             int height = H + (int)abs(cx - X[0]) + (int)abs(cy - Y[0]);
      |                                                                   ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main(){
    int N;
    cin>>N;
    int x[110],y[110],h[110];
    int max_hight=-1;
    int max_count=0;
    for(int i=0;i<N;i++){
        cin>>x[i]>>y[i]>>h[i];
        if(h[i]>max_hight){max_hight=h[i];max_count=1;}
        else if(h[i]==max_hight){max_count++;}
    }
    int cx=0,cy=0,hight;
    if(max_count==4){
        for(int i=0;i<N;i++){
           if(h[i]==max_hight){
               cx+=x[i];
               cy+=y[i];
           }
        }
        cx=round((double)cx/max_count);
        cy=round((double)cy/max_count);
        if(max_count==1){hight=max_hight;}
        else{hight=max_hight+1;}
    }
    if(max_count==1){
        for(int i=0;i<N;i++){
           if(h[i]==max_hight){
               cx+=x[i];
               cy+=y[i];
           }
        }
        cx=round((double)cx/max_count);
        cy=round((double)cy/max_count);
        if(max_count==1){hight=max_hight;}
        else{hight=max_hight+1;}
    }
    if(max_count==3){
        int ccx[3],ccy[3],k=0;
        for(int i=0;i<N;i++){
            if(h[i]==max_hight){
                ccx[k]=x[i];
                ccy[k]=y[i];
                k++;
            }
        int d1,d2,d3;
        for(int i=0;i<=100;i++){
            for(int j=0;j<=100;j++){
                d1=abs(i-ccx[0])+abs(j-ccy[0]);
                d2=abs(i-ccx[0])+abs(j-ccy[0]);
                d3=abs(i-ccx[0])+abs(j-ccy[0]);
                if(di==d2 && d2==d3){
                    cx=i;cy=j
                    hight=max_hight+d1;
                }
            }
        }
    }
    if(max_count==2){
        int ccx[2],ccy[2],cccx[2],cccy[2],dx,dy,k=0;
        for(int i=0;i<N;i++){
            if(h[i]==max_hight){
                ccx[k]=x[i];
                ccy[k]=y[i];
                k++;
            }
        }
        cccx
        for(int i=0;i<2;i++){
            if(dx!=ccx[i]){cx=ccx[i];}
            if(dy!=ccy[i]){cy=ccy[i];}
        }
        hight=max_hight+1;
    }
    
    cout<<cx<<" "<<cy<<" "<<hight<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:20: error: 'di' was not declared in this scope; did you mean 'i'?
   55 |                 if(di==d2 && d2==d3){
      |                    ^~
      |                    i
a.cc:56:30: error: expected ';' before 'hight'
   56 |                     cx=i;cy=j
      |                              ^
      |                              ;
   57 |                     hight=max_hight+d1;
      |                     ~~~~~     
a.cc:71:13: error: expected ';' before 'for'
   71 |         cccx
      |             ^
      |             ;
   72 |         for(int i=0;i<2;i++){
      |         ~~~  
a.cc:72:21: error: 'i' was not declared in this scope
   72 |         for(int i=0;i<2;i++){
      |                     ^
a.cc:82:2: error: expected '}' at end of input
   82 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: Java

import java.util.*;
public class C2 {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int times = sc.nextInt();
		int [] Cx = new int[times];
		int [] Cy = new int[times];
		int [] h = new int[times];
		int H = 0;        // H = h+(|X−CX|+|Y−CY)
		boolean ff = false;
		
	//	ArrayList<Integer> judge = new ArrayList<Integer>();
		
		
		
		for(int i = 0 ; i<times; i++) {
			Cx[i] = sc.nextInt();
			Cy[i] = sc.nextInt();
			h[i] = sc.nextInt();
		}

		for(int i = 0 ; i<=100; i++) {
			for(int j = 0 ; j<=100; j++) {
				int judge = 0;
				H = Math.abs(i-Cx[0])+Math.abs(j-Cy[0])+h[0];
				if(H>0) {
					for(int k = 0 ; k<times; k++) {
						int compare = Math.abs(i-Cx[k])+Math.abs(j-Cy[k])+h[k];
						if(H==compare) {
							judge++;
						}
					}
					if(judge==times) {
						System.out.println(i+" "+j+" "+H);
						ff = true;
						break;
					}
				}
			}
			if(ff==true) {
				break;
			}
		}
	}
}


Compiler output:
Main.java:2: error: class C2 is public, should be declared in a file named C2.java
public class C2 {
       ^
1 error
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
		int n,i;
		scanf("%d",&n);
		long xyh[n][3];
		for(i=0;i<n;i++){
				scanf("%ld%ld%ld",&xyh[i][0],&xyh[i][1],&xyh[i][2]);
		}
		int cx,cy,flag=0;long h,tmp;
		for(cx=0;cx<=100;cx++){
				for(cy=0;cy<=100;cy++){
				//		printf("%d %d\n",cx,cy);
						flag=0;
						for(i=0;i<n;i++){
								if(xyh[i][2]>0){
										h=xyh[i][2]+abs(xyh[i][0]-cx)+abs(xyh[i][1]-cy);
								else if(tmp-abs(xyh[i][0]-cx)-abs(xyh[i][1]-cy)>0){
										flag=1;
										break;
								}else h=tmp;
								if(i==0){
										tmp=h;
								}
								if(tmp!=h){
										flag=1;
										break;
								}
								}
						}
								if(flag==0){
										printf("%d %d %ld",cx,cy,tmp);
										return 0;
								}
				}
/*						int tmp=xyh[i][2]-abs(xyh[j][0]-xyh[i][0])-abs(xyh[j][1]-xyh[i][1]);
						if(tmp<0)tmp=0;
						if(xyh[j][2]=!tmp)break;*/
		}
}


Compiler output:
main.c: In function 'main':
main.c:19:65: error: expected '}' before 'else'
   19 |                                                                 else if(tmp-abs(xyh[i][0]-cx)-abs(xyh[i][1]-cy)>0){
      |                                                                 ^~~~
main.c: At top level:
main.c:41:1: error: expected identifier or '(' before '}' token
   41 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
int main()
{
  int n;
  vector<int> x(100),y(100),h(100);
  cin>>n;
  for(int i=0;i<n;i++) cin>>x.at(i)>>y.at(i)>>h.at(i);

  int cx,cy,high;
  //cx,cyを全探索する
  vector<int> det(100,0);
  for(int i=0;i<101;i++)//cx
  {
  for(int j=0;j<101;j++)//cy
  {
    for(int k=0;k<n;k++)
    {
      det.at(k)=abs(i-x.at(k))+abs(j-y.at(k));
      //中心と仮定した点からの距離
    }
    //全ての点に対し，det+hが等しくなればok
    int cnt=0;
    int tmp=h.at(0)+det.at(0);
    for(int l=0;l<n;l++)
    {
      if(tmp==(h.at(l)+det.at(l))) cnt++;
      else if(x.at(l)==0 && y.at(l)==0) cnt++;
    }

    if(cnt==n)
    {
      flag=true;
      high=h.at(0)+det.at(0);
      cx=i,cy=j;
    }

  }
  }
  cout<<cx<<' '<<cy<<' '<<high<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:7: error: 'flag' was not declared in this scope
   37 |       flag=true;
      |       ^~~~
Language: C++

#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(a) int((a).size())
#define all(a) (a).begin(),(a).end()
#define in insert

const int inf = int (1e9) + 7;
const double eps = 1e-9;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;
int x[111], y[111], h[111], n;

inline bool check (int X, int Y) {
	ll height;
	for (int i=1; i<=n; ++i) {
		if (h[i]) {
			height = 1ll * abs (X - x[1]) + abs (Y - y[1]) + h[1]
			break;
		}
	}
	for (int i=1; i<=n; ++i) {
		if (1ll * abs (X - x[i]) + abs (Y - y[i]) + h[i] != height)
			return false;
	}
	return true;
}

int main () {
	#ifdef nurik
	freopen ("in", "r", stdin);
	#endif

	vector <pair <int, pair <int, int> > > res;
	cin >> n;

	for (int i=1; i<=n; ++i)
		cin >> x[i] >> y[i] >> h[i];

	for (int i=0; i<=100; ++i) 
		for (int j=0; j<=100; ++j)
			if (check(i, j)) {
				res.pb ({i,{j, 1ll * abs (i - x[1]) + abs (j - y[1]) + h[1]}});
			}

	if (sz (res) == 1)
		cout << res[0].F << " " << res[0].S.F << " " << res[0].S.S;

	return 0;
}
















Compiler output:
a.cc: In function 'bool check(int, int)':
a.cc:25:78: error: expected ';' before 'break'
   25 |                         height = 1ll * abs (X - x[1]) + abs (Y - y[1]) + h[1]
      |                                                                              ^
      |                                                                              ;
   26 |                         break;
      |                         ~~~~~
Language: C++

#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(a) int((a).size())
#define all(a) (a).begin(),(a).end()
#define in insert

const int inf = int (1e9) + 7;
const double eps = 1e-9;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;
int x[111], y[111], h[111], n;

inline bool check (int X, int Y) {
	ll height = 1ll * abs (X - x[1]) + abs (Y - y[1]) + h[1];
	for (int i=1; i<=n; ++i) {
		if (1ll * abs (X - x[i]) + abs (Y - y[i]) + h[i] != height)
			return false;
	}
	return true;
}

int main () {
	#ifdef nurik
	freopen ("in", "r", stdin);
	#endif

	vector <pair <int, pair <int, int> > > res;
	cin >> n;

	for (int i=1; i<=n; ++i)
		cin >> x[i] >> y[i] >> h[i];

	for (int i=0; i<=100; ++i) 
		for (int j=0; j<=100; ++j)
			if (check(i, j)) {
				res.pb ({i,{j, 1ll * abs (i - x[1]) + abs (j - y[1]) + h[1]}})
			}

	if (sz (res) == 1)
		cout << res.F << " " << res.S.F << " " << res.S.S;

	return 0;
}
















Compiler output:
a.cc: In function 'int main()':
a.cc:44:95: error: expected ';' before '}' token
   44 |                                 res.pb ({i,{j, 1ll * abs (i - x[1]) + abs (j - y[1]) + h[1]}})
      |                                                                                               ^
      |                                                                                               ;
   45 |                         }
      |                         ~                                                                      
a.cc:5:11: error: 'class std::vector<std::pair<int, std::pair<int, int> > >' has no member named 'first'
    5 | #define F first
      |           ^~~~~
a.cc:48:29: note: in expansion of macro 'F'
   48 |                 cout << res.F << " " << res.S.F << " " << res.S.S;
      |                             ^
a.cc:6:11: error: 'class std::vector<std::pair<int, std::pair<int, int> > >' has no member named 'second'
    6 | #define S second
      |           ^~~~~~
a.cc:48:45: note: in expansion of macro 'S'
   48 |                 cout << res.F << " " << res.S.F << " " << res.S.S;
      |                                             ^
a.cc:6:11: error: 'class std::vector<std::pair<int, std::pair<int, int> > >' has no member named 'second'
    6 | #define S second
      |           ^~~~~~
a.cc:48:63: note: in expansion of macro 'S'
   48 |                 cout << res.F << " " << res.S.F << " " << res.S.S;
      |                                                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin>>n;
    vector<int>x(n),y(n),h(n);
    rep(i,n)cin>>x[i]>>y[i]>>h[i];
    
    rep(i,101)rep(j,101){
        int H=abs(x[0]-i)+abs(y[0]-j)+h[0];
        rep(k,n){
            if(h[i]!=max(H-abs(x[k]-i)-abs(y[k]-j),0)break;
            if(k+1==n){
                cout<<i<<j<<H <<endl;
                return 0;
            }
        
        
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:54: error: expected ';' before 'break'
   21 |             if(h[i]!=max(H-abs(x[k]-i)-abs(y[k]-j),0)break;
      |                                                      ^~~~~
      |                                                      ;
a.cc:22:13: error: expected primary-expression before 'if'
   22 |             if(k+1==n){
      |             ^~
a.cc:21:60: error: expected ')' before 'if'
   21 |             if(h[i]!=max(H-abs(x[k]-i)-abs(y[k]-j),0)break;
      |               ~                                            ^
      |                                                            )
   22 |             if(k+1==n){
      |             ~~                                              
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:18:25: note: to match this '{'
   18 |     rep(i,101)rep(j,101){
      |                         ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include <stdio.h>
#include <math.h>

int main(){
    
    int N;
    int x,y,Cx,Cy;
    float h,H;

    int x_sum=0,y_sum=0,h_sum=0;
    int x_ave,y_ave,h_ave;

    scanf("%d",&N);

    for(int i=0;i<N;i++){

        scanf("%d %d %f",&x,&y,&h);
        if(h>0){
            x_sum = x_sum +x;
            y_sum = y_sum +y;
            h_sum = h_sum +h;
            x_ave = x_ave + x*h/hsum;
            y_ave = y_ave + y*h/hsum;
        }
    }

    Cx = x_ave;
    Cy = y_ave;
    H = h + abs(x -x_ave)+abs(y-y_ave);
    
    printf("%d %d %f",Cx,Cy,H);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: 'hsum' was not declared in this scope; did you mean 'h_sum'?
   22 |             x_ave = x_ave + x*h/hsum;
      |                                 ^~~~
      |                                 h_sum
Language: C++

#include <stdio.h>
#include <math.h>

int main(){
    
    int N;
    int x,y,Cx,Cy;
    unsigned float h,H;

    int x_sum=0,y_sum=0,h_sum=0;
    int x_ave,y_ave,h_ave;

    scanf("%d",&N);

    for(int i=0;i<N;i++){

        scanf("%d %d %d",&x,&y,&h);
        if(h>0){
            x_sum = x_sum +x;
            y_sum = y_sum +y;
            h_sum = h_sum +h;
            x_ave = x_ave + x*h/hsum;
            y_ave = y_ave + y*h/hsum;
        }
    }

    Cx = x_ave;
    Cy = y_ave;
    H = h + abs(x -x_ave)+abs(y-y_ave);
    
    printf("%d %d %f",Cx,Cy,H);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'unsigned' specified with 'float'
    8 |     unsigned float h,H;
      |     ^~~~~~~~
a.cc:8:5: error: 'unsigned' specified with 'float'
a.cc:22:33: error: 'hsum' was not declared in this scope; did you mean 'h_sum'?
   22 |             x_ave = x_ave + x*h/hsum;
      |                                 ^~~~
      |                                 h_sum
Language: Java

import java.util.*;

public class C{

     public static void main(String []args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x[] = new int[n];
        int y[] = new int[n];
        int h[] = new int[n];
        
        for(int i=0;i<n;i++){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            h[i] = sc.nextInt();
        }
        
        
        loop:
        for(int i=0;i<=100;i++){
            for(int j=0;j<=100;j++){
                int H;
                
                if(h[0] > 0){
                    H = Math.abs(i-x[0]) + Math.abs(j-y[0]) + h[0];
                    
                    if(check(x, y, h, H, i, j)){
                        System.out.println(i+" "+j+" "+H);
                        break loop;
                    }
                }
                else{
                    for(H = 1; H<=Math.abs(i-x[0]) + Math.abs(j-y[0]);H++){
                        if(check(x, y, h, H, i, j)){
                            System.out.println(i+" "+j+" "+H);
                            break loop;
                        }
                    }
                }
                
                
            }
        }
        
    
     }
     
     static boolean check(int x[], int y[], int h[], int H, int cx, int cy){
         for(int i=1;i<x.length;i++){
             if(Math.max(H - Math.abs(cx - x[i]) - Math.abs(cy - y[i]), 0) != h[i]){
                 return false;
             }
         }
         
         return true;
     }
}

Compiler output:
Main.java:3: error: class C is public, should be declared in a file named C.java
public class C{
       ^
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long int;
typedef pair<int,int> P;
int INF = (1 << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector< tuple<int,int,int> > v;
    rep(i,0,N){
        int a,b,c;
        cin >> a >> b >> c;
        if(c == 0)continue;
        v.push_back(make_tuple(a,b,c));
    }
    N = v.size();
    int maxh = 0,maxx,maxy;
    rep(x,0,101)rep(y,0,101){
        int dif = abs(x - get<0>(v[0])) + abs(y - get<1>(v[0]));
        int high = get<2>(v[0]);
        bool flag = 0;
        rep(i,0,N){
            int dd = abs(x - get<0>(v[i])) + abs(y - get<1>(v[i]));
            
            int hh = get<2>(v[i]);

            //cout << dd << " " << hh << endl;

            if(high + dif != hh + dd){
                flag = 1;
                break;
            }
        }
        if(flag)continue;
        int h = high + dif;
        if(maxh < h){
            maxh = h;
            maxx = x;
            maxy = y;
            //cout << x << " " << y << " " << h << endl;
        }
    }
    cout << maxx << " " << maxy << " " << maxh << endl;
}

Compiler output:
a.cc:4:19: error: declaration does not declare anything [-fpermissive]
    4 | typedef long long int;
      |                   ^~~
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long int;
typedef pair<int,int> P;
int INF = (1int << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector< tuple<int,int,int> > v;
    rep(i,0,N){
        int a,b,c;
        cin >> a >> b >> c;
        if(c == 0)continue;
        v.push_back(make_tuple(a,b,c));
    }
    N = v.size();
    int maxh = 0,maxx,maxy;
    rep(x,0,101)rep(y,0,101){
        int dif = abs(x - get<0>(v[0])) + abs(y - get<1>(v[0]));
        int high = get<2>(v[0]);
        bool flag = 0;
        rep(i,0,N){
            int dd = abs(x - get<0>(v[i])) + abs(y - get<1>(v[i]));
            
            int hh = get<2>(v[i]);

            //cout << dd << " " << hh << endl;

            if(high + dif != hh + dd){
                flag = 1;
                break;
            }
        }
        if(flag)continue;
        int h = high + dif;
        if(maxh < h){
            maxh = h;
            maxx = x;
            maxy = y;
            //cout << x << " " << y << " " << h << endl;
        }
    }
    cout << maxx << " " << maxy << " " << maxh << endl;
}

Compiler output:
a.cc:4:19: error: declaration does not declare anything [-fpermissive]
    4 | typedef long long int;
      |                   ^~~
a.cc:6:12: error: unable to find numeric literal operator 'operator""int'
    6 | int INF = (1int << 30) - 1;
      |            ^~~~
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
Language: C++

N = int(input())
xyh = [[int(i) for i in input().split()] for j in range(N)]
for i in range(0,101):
    for j in range(0,101):
        H0 = xyh[0][2] + abs(i-xyh[0][0]) + abs(j-xyh[0][1])
        flag = True
        for k in xyh:
            x = k[0] ; y = k[1] ; h = k[2]
            H = h+abs(i-x)+abs(j-y)
            if H0 != H:
                flag = False
                break
        if flag == True:
            break
    if flag == True:
        break
print (*[i,j,H])


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
a.cc:8:24: error: 'y' does not name a type
    8 |             x = k[0] ; y = k[1] ; h = k[2]
      |                        ^
a.cc:8:35: error: 'h' does not name a type
    8 |             x = k[0] ; y = k[1] ; h = k[2]
      |                                   ^
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    int n;
    cin >> n;
    ll x[110]={};
    ll y[110]={};
    ll h[110]={};
    bool flag = false;
    rep(i,n) cin >> x[i] >> y[i] >> h[i];
    ll nx,ny,nh;
    rep(i,n)
        if(h[i]!=0) nx=x[i],ny=y[i],nh=h[i];
    rep(tx,101){
        rep(ty,101){
            ll tall = llabs(tx-nx)+llabs(ty-ny)+nh;
            int i;
            for(i=0;i<n;i++){
                if(h[i]==0) flag = true;
                if(flag){
                    if(tall <= llabs((ll) tx - x[i]) + llabs((ll) ty - y[i]) + (ll) h[i])
                }else {
                    if (tall != llabs((ll) tx - x[i]) + llabs((ll) ty - y[i]) + (ll) h[i]) {
                        break;
                    }
                }
            }
            if(i==n){
                cout << tx << " " << ty << " " << tall << endl;
                return 0;
            }

        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: expected primary-expression before '}' token
   46 |                 }else {
      |                 ^
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    int n;
    cin >> n;
    ll x[110]={};
    ll y[110]={};
    ll h[110]={};
    bool flag = false;
    rep(i,n) cin >> x[i] >> y[i] >> h[i];
    ll nx,ny,nh;
    rep(i,n)
        if(h[i]!=0) nx=x[i],ny=y[i],nh=h[i];
    rep(tx,101){
        rep(ty,101){
            ll tall = llabs(tx-nx)+llabs(ty-ny)+nh;
            if(h[0]==0) flag = true;
            int i;
            for(i=0;i<n;i++){
                if(h[i]==0) flag = true;
                if(flag){
                    if(tall != llabs((ll) tx - x[i]) + llabs((ll) ty - y[i]) + (ll) h[i])
                }else {
                    if (tall != llabs((ll) tx - x[i]) + llabs((ll) ty - y[i]) + (ll) h[i]) {
                        break;
                    }
                }
            }
            if(i==n){
                cout << tx << " " << ty << " " << tall << endl;
                return 0;
            }

        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:17: error: expected primary-expression before '}' token
   47 |                 }else {
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll INF = (1LL << 30) - 1;
ll MOD = 1e9+7;
main(){
    ll N;
    cin >> N;
    vector< tuple<ll,ll,ll> > v;
    rep(i,0,N){
        ll a,b,c;
        cin >> a >> b >> c;
        if(c == 0)continue;
        v.push_back(make_tuple(a,b,c));
    }
    N = v.size();
    ll maxh = 0,maxx,maxy;
    rep(x,0,101)rep(y,0,101){
        rep(j,0,N)
        ll dif = abs(x - get<0>(v[j])) + abs(y - get<1>(v[j]));
        ll high = get<2>(v[j]);
        bool flag = 0;
        rep(i,0,N){
            ll dd = abs(x - get<0>(v[i])) + abs(y - get<1>(v[i]));
            
            ll hh = get<2>(v[i]);

            //cout << dd << " " << hh << endl;

            if(high + dif != hh + dd){
                flag = 1;
                break;
            }
        }
        if(flag)continue;
        ll h = high + dif;
        if(maxh <= h){
            maxh = h;
            maxx = x;
            maxy = y;
            //cout << x << " " << y << " " << h << endl;
        }
    }
    cout << maxx << " " << maxy << " " << maxh << endl;
}

Compiler output:
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:23:28: error: 'j' was not declared in this scope
   23 |         ll high = get<2>(v[j]);
      |                            ^
a.cc:32:23: error: 'dif' was not declared in this scope; did you mean 'div'?
   32 |             if(high + dif != hh + dd){
      |                       ^~~
      |                       div
a.cc:38:23: error: 'dif' was not declared in this scope; did you mean 'div'?
   38 |         ll h = high + dif;
      |                       ^~~
      |                       div
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int n = sc.nextInt();
        int[] xA = new int[n];
        int[] yA = new int[n];
        int[] hA = new int[n];
 
        for (int i = 0; i < n; i++) {
            xA[i] = sc.nextInt();
            yA[i] = sc.nextInt();
            hA[i] = sc.nextInt();
        }
 
        for (int x = 0; x <= 100; x++) {
            for (int y = 0; y <= 100; y++) {
                int i = 0;
                int h = Math.max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0);
                if (h > MAth.abs(xA[i] - x) + Math.abs(yA[i] - y))
                    continue;
                while (true) {
                    i++;
                    if (i >= n) {
                        System.out.println(x + " " + y + " " + h);
                        System.exit(0);
                    }
 
                    if (h != Math.max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0))
                        break;
                }
            }
        }
    }
}

Compiler output:
Main.java:22: error: cannot find symbol
                if (h > MAth.abs(xA[i] - x) + Math.abs(yA[i] - y))
                        ^
  symbol:   variable MAth
  location: class Main
1 error
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
 
        int n = sc.nextInt();
        int[] xA = new int[n];
        int[] yA = new int[n];
        int[] hA = new int[n];
 
        for (int i = 0; i < n; i++) {
            xA[i] = sc.nextInt();
            yA[i] = sc.nextInt();
            hA[i] = sc.nextInt();
        }
 
        for (int x = 0; x <= 100; x++) {
            for (int y = 0; y <= 100; y++) {
                int i = 0;
                int h = Math.Max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0);
                if (h < 0)
                    continue;
                do {
                    i++;
                    if (i >= n) {
                        System.out.println(x + " " + y + " " + h);
                        System.exit(0);
                    }
                } while (h == Math.Max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0));
            }
        }
    }
}

Compiler output:
Main.java:21: error: cannot find symbol
                int h = Math.Max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0);
                            ^
  symbol:   method Max(int,int)
  location: class Math
Main.java:30: error: cannot find symbol
                } while (h == Math.Max(hA[i] + Math.abs(xA[i] - x) + Math.abs(yA[i] - y), 0));
                                  ^
  symbol:   method Max(int,int)
  location: class Math
2 errors
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;



int main()
{
    int N;
    cin >> N;
    vector<int> XY[N];
    for (int i = 0; i < N; i++) {
        int x,y,h;
        cin >> x >> y >> h;
        XY[i].push_back(x);
        XY[i].push_back(y);
        XY[i].push_back(h);
    }
    int Cx,Cy,high;
    int highm;

    for (int i = 0; i <= 100; i++)
        for(int j = 0; j <= 100; j++){
            int b = 1;
            for(int k = 0; k < N; k++) {
                if(XY[k][2]==0)
                    continue;
                if (b == 1) {
                    high = abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2];
                    b = 0;
                    break;
                }
            }
            for (int k = 0; k < N; k++) {
                if (XY[k][2] == 0){
                    if (high > abs(XY[k][0]-i)+abs(XY[k][1]-j))
                        break;
                    high = min(high,abs(XY[k][0]-i)+abs(XY[k][2]-j))
                }
                if (high !=   abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2])
                    break;
                if (k==N-1){
                    Cx = i; Cy = j;
                    highm = high;
                }
            }
        }
    if (highm <= 0)
        highm = 1;

    cout << Cx << ' ' << Cy << ' ' << highm << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:69: error: expected ';' before '}' token
   47 |                     high = min(high,abs(XY[k][0]-i)+abs(XY[k][2]-j))
      |                                                                     ^
      |                                                                     ;
   48 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;

int main()
{
    int n;
    vector<int> XYH[n];
    for (int i = 0; i < n; i++) {
        int x,y,h;
        cin >> x >> y >> h;
        XYH[i].push_back(x);
        XYH[i].push_back(y);
        XYH[i].push_back(h);
    }

    for (int i = 0; i <= 100; i++)
        for (int j = 0; j <= 100; j++) {
            f = 0; ok = 1;
            for (int k = 0; k < N; k++){
                if (f) {
                    if ()
                }
            }
        }

}

int main()
{
    int N;
    cin >> N;
    vector<int> XY[N];
    for (int i = 0; i < N; i++) {
        int x,y,h;
        cin >> x >> y >> h;
        XY[i].push_back(x);
        XY[i].push_back(y);
        XY[i].push_back(h);
    }
    int Cx,Cy,high;
    int highm;

    for (int i = 0; i <= 100; i++)
        for(int j = 0; j <= 100; j++){
            int b = 1;
            for(int k = 0; k < N; k++) {
                if(XY[k][2]==0)
                    continue;
                if (b == 1) {
                    high = abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2];
                    b = 0;
                    break;
                }
            }
            for (int k = 0; k < N; k++) {
                if (XY[k][2] == 0){
                    if (high > abs(XY[k][0]-i)+abs(XY[k][1]-j))
                        break;
                    high = min(high,abs(XY[k][0]-i)+abs(XY[k][2]-j))
                }
                if (high !=   abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2])
                    break;
                if (k==N-1){
                    Cx = i; Cy = j;
                    highm = high;
                }
            }
        }
    if (highm <= 0)
        highm = 1;

    cout << Cx << ' ' << Cy << ' ' << highm << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: 'f' was not declared in this scope
   28 |             f = 0; ok = 1;
      |             ^
a.cc:28:20: error: 'ok' was not declared in this scope
   28 |             f = 0; ok = 1;
      |                    ^~
a.cc:29:33: error: 'N' was not declared in this scope
   29 |             for (int k = 0; k < N; k++){
      |                                 ^
a.cc:31:25: error: expected primary-expression before ')' token
   31 |                     if ()
      |                         ^
a.cc:32:17: error: expected primary-expression before '}' token
   32 |                 }
      |                 ^
a.cc: At global scope:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main()
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:69:69: error: expected ';' before '}' token
   69 |                     high = min(high,abs(XY[k][0]-i)+abs(XY[k][2]-j))
      |                                                                     ^
      |                                                                     ;
   70 |                 }
      |                 ~
Language: C++

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

typedef long long LL;
typedef pair<int, int> PII;

#define fir fisrt
#define sec second

int n, x[105], y[105], h[105];
bool vis[105][105];

int main(){
	scanf(" %d", &n);
	int ert = 1;
	for(int i = 1; i <= n; i ++){
		scanf(" %d %d %d", &x[i], &y[i], &h[i]);
		if(h[i] > 0) ert = i;
		vis[x[i]][y[i]] = 1;
	}
	bool VIS = 0;
	int H;
	int pos = 0;
	int resx = -1, resy = -1, resh = -1;
	for(int i = 0; i <= 100; i ++){
		for(int j = 0; j <= 100; j ++){
			H = h[ery] + abs(i - x[ert]) + abs(j - y[ert]);
			VIS = 0;
			pos = 0;
			for(int k = 1; k <= n; k ++){
				if(h[k] - max(H - abs(i - x[k]) - abs(j - y[k]), 0) != 0){
					VIS = 1;
					break;
				}
			}
			if(VIS == 0){
				pos = 1;
				resx = i;
				resy = j;
				resh = H;
				break;
			}
		}
		if(VIS == 0 && pos == 1) break;
	}
	/*if(resx == -1){
	  for(int i = 1; i <= n; i ++){
	  VIS = 0;
	  for(int j = 1; j <= n; j ++){
	  if(h[i] < h[j]){
	  VIS = 1;
	  break;
	  }
	  if(h[i] - h[j] - abs(x[i] - x[j]) - abs(y[i] - y[j]) != 0){
	  VIS = 1;
	  break;
	  }
	  }
	  if(VIS == 0){
	  resx = x[i];
	  resy = y[i];
	  resh = h[i];
	  break;
	  }
	  }
	  }*/
	printf("%d %d %d\n", resx, resy, resh);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:31: error: 'ery' was not declared in this scope; did you mean 'ert'?
   34 |                         H = h[ery] + abs(i - x[ert]) + abs(j - y[ert]);
      |                               ^~~
      |                               ert
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;
 
int main()
{
    int N;
    cin >> N;
    vector<int> XY[N];
    for (int i = 0; i < N; i++) {
        int x,y,h;
        cin >> x >> y >> h;
        XY[i].push_back(x);
        XY[i].push_back(y);
        XY[i].push_back(h);
    }
    int Cx,Cy;
    int highm;
 
    for (int i = 0; i <= 100; i++)
        for(int j = 0; j <= 100; j++){
            int b = 1;
            for(int k = 0; k < N; k++) {
                if(XY[k][2]==0)
                    continue;
                if (b == 1) {
                    high = abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2];
                    b = 0;
                    break;
                }
            }
            for (int k = 0; k < N; k++) {
                if (XY[k][2] == 0)
                    if (high > abs(XY[k][0]-i)+abs(XY[k][1]-j))
                        break;
                if (high !=   abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2])
                    break;
                if (k==N-1){
                    Cx = i; Cy = j;
                    highm = high;
                }
            }
        }
    if (highm <= 0)
        highm = 1;
    
    cout << Cx << ' ' << Cy << ' ' << highm << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: 'high' was not declared in this scope; did you mean 'highm'?
   36 |                     high = abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2];
      |                     ^~~~
      |                     highm
a.cc:43:25: error: 'high' was not declared in this scope; did you mean 'highm'?
   43 |                     if (high > abs(XY[k][0]-i)+abs(XY[k][1]-j))
      |                         ^~~~
      |                         highm
a.cc:45:21: error: 'high' was not declared in this scope; did you mean 'highm'?
   45 |                 if (high !=   abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2])
      |                     ^~~~
      |                     highm
a.cc:49:29: error: 'high' was not declared in this scope; did you mean 'highm'?
   49 |                     highm = high;
      |                             ^~~~
      |                             highm
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;

int main()
{
    int n;
    cin >> n;
    vector<int>x(n,-1);
    vector<int>y(n,-1);
    vector<int>h(n,-1);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i] >> h[i];
    }
}


int main()
{
    int N;
    cin >> N;
    vector<int> XY[N];
    for (int i = 0; i < N; i++) {
        int x,y,h;
        cin >> x >> y >> h;
        XY[i].push_back(x);
        XY[i].push_back(y);
        XY[i].push_back(h);
    }
    int Cx=-1,Cy=-1,high=0;
    int highm=0;

    for (int i = 0; i <= 100; i++)
        for(int j = 0; j <= 100; j++){
            int high = 0;
            int b = 1;
            for(int k = 0; k < N; k++) {
                if(XY[k][2]==0)
                    continue;
                if (b == 1) {
                    high = abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2];
                    b = 0;
                }
            }
            for (int k = 0; k < N; k++) {
                if (XY[k][2] == 0)
                    if (high > abs(XY[k][0]-i)+abs(XY[k][1]-j))
                        break;
                if (high != abs(XY[k][0]-i)+abs(XY[k][1]-j) + XY[k][2])
                    break;
                if (k==N-1){
                    Cx = i; Cy = j;
                    highm = high;
                }
            }
        }
    if (highm == 0) {
        highm=1;
        for (int i = 0; i <= 100; i++)
            for (int j = 0; j <= 100; j++)
                for (int k = 0; k < N; k++){
                    if (i != XY[k][0] || j != XY[k][1]) {
                        cout << i << ' ' << j << ' ' << highm << endl;
                        return 0;
                    }
                }

    }
    cout << Cx << ' ' << Cy << ' ' << highm << endl;
}


Compiler output:
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main()
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main()
      |     ^~~~