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

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

int main()
{
    int N;
    cin >> N;

    int x[100] = { 0 }, y[100] = { 0 }, h[100] = { 0 };
    for( int i = 0; i < N; ++i )
        cin >> x[i] >> y[i] >> h[i];

    int CX, CY, H;
    int tmp, tmp_h = -1, min = INT_MAX;
    bool flag = true;

    for( CX = 0; CX <= 100; ++CX ){
        for( CY = 0; CY <= 100; ++CY ){
            for( int i = 0; i < N; ++i ){
                tmp = abs(x[i]-CX) + abs(y[i]-CY);
                if( h[i] == 0 )
                    min = tmp;
                else {
                    if( tmp_h != -1 && tmp_h != h[i]+tmp ){ flag = false; break; }
                    else tmp_h = h[i] + tmp;
                }
            }

            if( flag ){
                if( min != INT_MAX && tmp_h < min ) tmp_h = -1;
                else {
                    cout << CX << " " << CY << " ";
                    cout << tmp_h << endl;
                }
            } else {
                tmp_h = -1;
                flag = true;
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: 'INT_MAX' was not declared in this scope
   15 |     int tmp, tmp_h = -1, min = INT_MAX;
      |                                ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cstdlib>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <bitset>
#include <utility>
#include <sstream>
#include <fstream>
#include <stack>
#include <cstdlib>
#include <complex>
#include <set>
#include <unordered_map>
#include <map>

using namespace std;

#define INF 1070000000LL
#define pb push_back
#define irep(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) irep(i,0,n)

typedef long long lint;
typedef pair<int, int> pint;
struct Edge{
    int to,weight;
};
typedef vector<vector<Edge> > Graph;

int main(){
    int n;
    cin >> n;
    lint x[n],y[n],h[n];
    rep(i,n){
	cin >> x[i] >> y[i] >> h[i];
    }

    lint h_temp = -1;
    int flg=0;
    int cx=-1,cy=-1;
    rep(j,101){
	rep(k,101){
	    h_temp = -1;
	    rep(i,n){
		if(h[i] == 0)continue;
		if(h_temp < 0){
		    h_temp = h[i]+abs(x[i]-j)+abs(y[i]-k);
		    continue;
		}
		else{
		    if(h_temp != h[i]+abs(x[i]-j)+abs(y[i]-k)){
			break;
		    }
		}
		if(i+1 == n){
		    flg=1;
		}
	    }
	    if(flg == 1){
		cy=k;
		break;
	    }
	}
	if(flg == 1){
	    cx=j;
	    break;
	}
    }

    cout << cx << " " <<  cy << " " <<  h_temp << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:76:56: error: expected '}' at end of input
   76 |     cout << cx << " " <<  cy << " " <<  h_temp << endl;
      |                                                        ^
a.cc:36:11: note: to match this '{'
   36 | int main(){
      |           ^
Language: C++

#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main(void){
    int n;
    cin >> n;
    int cx,cy,ch;
    vector<int> x(n),y(n),h(n);
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i] >> h[i];
    }
    for(cx=0; cx<=100; cx++){
        for(cy=0; cy<=100; cy++){
            for(ch=1; ch<=100001000; i++){
                for(int i=0; i<n; i++){
                    if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0))break;
                    if(i==n-1){
                        cout << cx << " " << cy << " " << ch << endl;
                        return 0;
                    }
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:38: error: 'i' was not declared in this scope
   20 |             for(ch=1; ch<=100001000; i++){
      |                                      ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int n,x1,x2,y1,y2;
    cin>>n;
    int x[n],y[n],h[n];
    for (int i=0; i<n; i++) {
        cin>>x[i]>>y[i]>>h[i];
    }
    for (int i=0; i<n; i++) {
        for (int j=i+1; j<n; j++) {
            if (h[i]==h[j]) {
                x1=x[i];
                x2=x[j];
                y1=y[j];
                y2=y[i];
            }
            else if (h[i]-h[j]==1) {
                    x1=x[i];
                    x2=x[i];
                    y1=y[i]+1;
                    y2=y[i]-1;
                }
            }
            else if (h[i]-h[j]==-1) {
                x1=x[j];
                x2=x[j];
                y1=y[j]+1;
                y2=y[j]-1;
            }
        }
    }




Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'else' without a previous 'if'
   25 |             else if (h[i]-h[j]==-1) {
      |             ^~~~
a.cc:25:29: error: 'j' was not declared in this scope
   25 |             else if (h[i]-h[j]==-1) {
      |                             ^
Language: C++

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

int n;
int lix[105],liy[105],lix[105];
int main()
{
   scanf("%d",&n);
   for(int i=1;i<=n;i++)
   {
      scanf("%d%d%d",&lix[i],&liy[i],&lih[i]);
   }
   for(int cx = 1;cx<=100;cx++)
   {
      for(int cy = 1;cy<=100;cy++)
      {
         int H = 0;
         for(int i=1;i<=n;i++)
         {
            if(lih[i]==0) continue;
            H = lih[i] + abs(lix[i]-cx) + abs(liy[i]-cy);
            break;
         }
         bool val = 1;
         for(int i=1;i<=n;i++)
         {
            int tmp = H - abs(lix[i]-cx) - abs(liy[i]-cy);
            if(tmp!=lih[i])
            {
               val = 0;
               break;
            }
         }
         if(val)
         {
            printf("%d %d %d\n",cx,cy,H);
            return 0;
         }
      }
   }
 	return 0;
}


Compiler output:
a.cc:5:23: error: redefinition of 'int lix [105]'
    5 | int lix[105],liy[105],lix[105];
      |                       ^~~
a.cc:5:5: note: 'int lix [105]' previously declared here
    5 | int lix[105],liy[105],lix[105];
      |     ^~~
a.cc: In function 'int main()':
a.cc:11:39: error: 'lih' was not declared in this scope; did you mean 'liy'?
   11 |       scanf("%d%d%d",&lix[i],&liy[i],&lih[i]);
      |                                       ^~~
      |                                       liy
a.cc:20:16: error: 'lih' was not declared in this scope; did you mean 'liy'?
   20 |             if(lih[i]==0) continue;
      |                ^~~
      |                liy
a.cc:21:17: error: 'lih' was not declared in this scope; did you mean 'liy'?
   21 |             H = lih[i] + abs(lix[i]-cx) + abs(liy[i]-cy);
      |                 ^~~
      |                 liy
a.cc:28:21: error: 'lih' was not declared in this scope; did you mean 'liy'?
   28 |             if(tmp!=lih[i])
      |                     ^~~
      |                     liy
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define v_exists(elem, v) find(v.begin(),v.end(),elem)!=v.end()

using namespace std;

int main(){


  int N;
  vector<vector<int>> coords;
  vector<long> h;

  cin >> N;

  rep(i,N){
    int x_,y_;
    long h_;
    scanf("%d %d %ld",&x_,&y_,&h_);
    vector<int> c;
    c.push_back(x_);
    c.push_back(y_);

    coords.push_back(c);
    h.push_back(h_);
  }

  long min_h = *min_element(h.begin(), h.end());

  rep(x,101){
    rep(y,101){

      for(long height=min_h; height<min_h+100; height++){

        bool ok = true;

        rep(i,coords.size()){
            long height_at_coord = height-abs(x-coords[i][0])-abs(y-coords[i][1]);
            if(height_at_coord < 0){
              height_at_coord = 0;
            }
            if(height_at_coord != h[i]){
              ok = false;
            }
        }

        if(ok){
          cout << x << ' ' << y << ' ' << height << endl;
          return 0;
        }

      }

    }
  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: 'min_element' was not declared in this scope
   33 |   long min_h = *min_element(h.begin(), h.end());
      |                 ^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
	int N, i, x, y, h, xy[105][105] = {};
	cin >> N;
	for (i = 0;i <= N;i++) {
		cin >> x >> y >> h;
		xy[x][y] = h;
		if (xy[x][y] == xy[x - 2][y]) {
			cout << x - 1 << y << h + 1 << endl;
			return 0;
		}
		else if (xy[x][y] == xy[x][y + 2]) {
			cout << x << y + 1 << h + 1 << endl;
			return 0;
		}
		else if (xy[x][y] == xy[x + 2][y]) {
			cout << x + 1 << y << h + 1 << endl;
			return 0;
		}
		else if (xy[x][y] == xy[x][y - 2]) {
			cout << x << y - 1 << h + 1 << endl;
			return 0;
		}
}

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

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    ll n; ll x[105][3]; bool xx[100200]={false};
    cin >> n;
    for(int a = 0; a < n; a++){
        cin >> x[a][0] >> x[a][1] >> x[a][2];
        xx[x[a][0]*101+x[a][2]] = true;
        if(x[a][2] == 0){
            n--;
            a--;
        }
        if(x[a][2] == 999999999){
            cout << x[a][0] << x[a][1] << x[a][2] << endl;
            return 0;
        }
    }
    if(a == 1){
        for(int a = 0; a < 101*101; a++){
            if(xx[a] == false){
                cout << a/101 << a%101 << 1 << endl;
                break;
            }
        }
        return 0;
    }
    for(int b = 0; b < 101; b++){
        for(int c = 0; c < 101; c++){
            ll h = x[0][2]+abs(x[0][1]-c)+abs(x[0][0]-b);
            for(int d = 1; d < n; d++){
                if(x[d][2] != h-abs(x[d][1]-c)-abs(x[d][0]-b))break;
                if(d == n-1){
                    cout << b << ' ' << c << ' ' << h << endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: 'a' was not declared in this scope
   22 |     if(a == 1){
      |        ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>

int N;
int x[100];
int y[100];
int h[100];


using namespace std;
int main(){
    long long int h_min = 10000000;
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%d%d%d",&x[i],&y[i],&h[i]);
        h_min = std::min(h_min,h[i]);
    }    

    h_min += 100;
    for(int cx = 0;cx <=100;cx++){
        for(int cy = 0;cy <=100;cy++){
            long long int h_,h_temp;
            h_ = abs(x[0]-cx)+abs(y[0]-cy) + h[0];
            for(int i=1;i<N;i++){
                h_temp = abs(x[i]-cx)+abs(y[i]-cy) + h[i];
                if(h_temp>1 && h_ == h_temp){
                    if(i==N-1){
                        printf("%d %d %d\n",cx,cy,h_);
                        return 0;
                    }
                }else{
                    break;
                }
            }
        }
    }
    printf("not reached\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: no matching function for call to 'min(long long int&, int&)'
   21 |         h_min = std::min(h_min,h[i]);
      |                 ~~~~~~~~^~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:21:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   21 |         h_min = std::min(h_min,h[i]);
      |                 ~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
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;
  bool flag=false;
  //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));
      //中心と仮定した点からの距離
    }
    //全ての点に対し，距離と高さの差の絶対値が等しくなれば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++;
    }

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

  }
  if(flag) break;
  }

  if(flag)
  cout<<cx<<' '<<cy<<' '<<high<<endl;
  else
  cout
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:7: error: expected ';' before '}' token
   50 |   cout
      |       ^
      |       ;
   51 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
//typedef pair<int,int> P;
//typedef pair<P,int> PP+
int N,x[101],y[101],h[101];
int C[101][101] = {0};
//vector<PP> v;
int main(){
	cin >> N;
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			C[i][j] = -1;
		}
	}
	for(int i=0;i<N;i++){
		cin >> x[i] >> y[i] >> h[i];
		for(int j=0;j<=100;j++){
			for(int k=0;k<=100;k++){
				int a = abs(x[i]-j),b = abs(y[i]-k);
				if(C[j][k]==-1){
					if(h[i]>0) C[j][k] = h[i]+a+b;
				}else if(h[i]!=0 && C[j][k]!=h[i]+a+b) C[j][k] = -100;
			}
		}
	}
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			int a = abs(x[0]-j),b = abs(y[0]-k);
     	     if(a+b==1){
				cout << i << " " << j << " " << C[i][j] << endl;
				return 0;
        	  }
          }
		}
	}
  for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			if(C[i][j]>0){
				cout << i << " " << j << " " << C[i][j] << endl;
				return 0;
			}
		}
	}
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:58: error: 'k' was not declared in this scope
   30 |                         int a = abs(x[0]-j),b = abs(y[0]-k);
      |                                                          ^
a.cc: At global scope:
a.cc:38:3: error: expected unqualified-id before 'for'
   38 |   for(int i=0;i<=100;i++){
      |   ^~~
a.cc:38:15: error: 'i' does not name a type
   38 |   for(int i=0;i<=100;i++){
      |               ^
a.cc:38:22: error: 'i' does not name a type
   38 |   for(int i=0;i<=100;i++){
      |                      ^
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main() {
    
    int n, x[101], y[101], h[101];
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i] >> h[i];
    }
    
    int candx = -1, candy = -1, candh = 0;
    for (int cx = 0; cx <= 100; cx++) {
        for (int cy = 0; cy <= 100; cy++) {
            int ch = 0;
            bool this_is_it = true;
            for (int i = 0; i < n; i++) {
                if (h[i] == 0) continue;
                int chv = h[i] + abs(x[i] - cx) + abs(y[i] - cy);
                if (ch == 0) {
                    ch = chv;
                } else if (h < 1 || ch != chv) {
                    this_is_it = false;
                    break;
                }
            }
            if (this_is_it) {
                cout << cx << " " << cy << " " << ch << endl;
                return 0;
            }
        }
    }
    
    cout << "nya~n" << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |                 } else if (h < 1 || ch != chv) {
      |                            ~~^~~
Language: C++

#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main(void){
    int n;
    cin >> n;
    int cx,cy,ch;
    vector<int> x(n),y(n),h(n);
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i] >> h[i];
    }
    for(cx=0; cx<=100; cx++){
        for(cy=0; cy<=100; cy++){
            ch=0;
            for(int i=0; i<n; i++){
                if(ch<=0)ch=h[i]+abs(x[i]-cx)+abs(y[i]-cy);
                else break;
            }
            for(int i=0; i<n; i++){
                if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0)break;
                if(i==n-1){
                    cout << cx << " " << cy << " " << ch << endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:61: error: expected ';' before 'break'
   26 |                 if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0)break;
      |                                                             ^~~~~
      |                                                             ;
a.cc:27:17: error: expected primary-expression before 'if'
   27 |                 if(i==n-1){
      |                 ^~
a.cc:26:67: error: expected ')' before 'if'
   26 |                 if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0)break;
      |                   ~                                               ^
      |                                                                   )
   27 |                 if(i==n-1){
      |                 ~~                                                 
a.cc:31:13: error: expected primary-expression before '}' token
   31 |             }
      |             ^
Language: C++

#include <stdio.h>
#define max(x,y) ((x)>(y)?(x):(y))
#define abs(x) ((x)<0?-1*(x):(x))
 
int main()
{
  int n;
  int x[105],y[105],h[105];
  int cx,cy,ch;
  int f,s;
  
  scanf("%d",&n);
  
  for(i=0;i<n;++i){
    scanf("%d%d%d",x+i,y+i,h+i);
    if(h[i]) s=i;
  }
  
  for(cx=0;cx<=100;++cx){
    for(cy=0;cy<=100;++cy){
      f=0;
      ch=h[s]+abs(x[s]-cx)+abs(y[s]-cy);
      
      for(i=0;i<n;++i){
        int tmp=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0);
        if(tmp==h[i])++f;
      }
      if(f==n)printf("%d %d %d",cx,cy,ch);
    }
  }
  
  return 0;
}
#include <stdio.h>
#define max(x,y) ((x)>(y)?(x):(y))
#define abs(x) ((x)<0?-1*(x):(x))

int main()
{
  int n;
  int x[105],y[105],h[105];
  int cx,cy,ch;
  int f,s;
  int i;
  
  scanf("%d",&n);
  
  for(i=0;i<n;++i){
    scanf("%d%d%d",x+i,y+i,h+i);
    if(h[i]) s=i;
  }
  
  for(cx=0;cx<=100;++cx){
    for(cy=0;cy<=100;++cy){
      f=0;
      ch=h[s]+abs(x[s]-cx)+abs(y[s]-cy);
      
      for(i=0;i<n;++i){
        int tmp=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0);
        if(tmp==h[i])++f;
      }
      if(f==n)printf("%d %d %d",cx,cy,ch);
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0;i<n;++i){
      |       ^
a.cc:24:11: error: 'i' was not declared in this scope
   24 |       for(i=0;i<n;++i){
      |           ^
a.cc: At global scope:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
Language: C++

#include <stdio.h>
#define max(x,y) ((x)>(y)?(x):(y))
#define abs(x) ((x)<0?-1*(x):(x))

int main()
{
  int n;
  int x[105],y[105],h[105];
  int cx,cy,ch;
  int f,s;
  
  scanf("%d",&n);
  
  for(i=0;i<n;++i){
    scanf("%d%d%d",x+i,y+i,h+i);
    if(h[i]) s=i;
  }
  
  for(cx=0;cx<=100;++cx){
    for(cy=0;cy<=100;++cy){
      f=0;
      ch=h[s]+abs(x[s]-cx)+abs(y[s]-cy);
      
      for(i=0;i<n;++i){
        int tmp=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0);
        if(tmp==h[i])++f;
      }
      if(f==n)printf("%d %d %d",cx,cy,ch);
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0;i<n;++i){
      |       ^
a.cc:24:11: error: 'i' was not declared in this scope
   24 |       for(i=0;i<n;++i){
      |           ^
Language: C

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

int f(int a){
  if(a<0)return -a;
  return a;
}

int main(void){
  int i,j,k,N,x[100],y[100],h[100];
  scanf("%d",&N);
  for(i=0;i<N;i++)scanf("%d%d%d",&x[i],&y[i],&h[i]);
  for(i=0;i<=100;i++)
    for(j=0;j<=100;j++)
      for(k=0;k<N-1;k++){
        if(h[k]-h[k+1]!=-f(x[k]-i)+f(x[k+1]-i)-f(y[k]-j)+f(y[k+1]-j))break;
        if(k==N-2){
          for(int l=0;!h[l];l++);
          printf("%d %d %d\n",i,j,h[l]+f(x[l]-i)+f(y[l]-j));
        }
      }
}


Compiler output:
main.c: In function 'main':
main.c:20:37: error: 'l' undeclared (first use in this function)
   20 |           printf("%d %d %d\n",i,j,h[l]+f(x[l]-i)+f(y[l]-j));
      |                                     ^
main.c:20:37: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
  int n, x[100], y[100], h[100];

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

  int mind = 1e9;
  for(int cx=0; cx<101; ++cx){
    for(int cy=0; cy<101; ++cy){

      int H = 1;
      for(int i=0; i<n; ++i){
	if(h[i] != 0){
	  int d = abs(x[i] - cx) + abs(y[i] - cy);
	  H = h[i] + d;
	  break;
	}
      }
      for(int i=0; i<n; ++i){
	int d = abs(x[i] - cx) + abs(y[i] - cy);
	if(h[i] != 0){
	  if(H != h[i] + d) break;
	}else{
	  if(H - d > 0) break;
	}
	if(i == n-1){
	  cout << cx << " " << cy << " " << H << endl;
	  return;
	}
      }

    }
  }
}


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

#include <bits/stdc++.h>
#include <fstream>
#include <vector>
#include <bitset>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <math.h>
#include <iomanip>
 
using namespace std;
  
/********** TEMPLATE STARTS HERE ***********/
    
#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define test int t; cin >> t; while(t--)
#define skip continue
#define stop break
#define sz(v) (int)v.size()
#define endl '\n'
#define PI 3.1415926535897932384626433832795
#define EPS 1e-9
#define gcd __gcd 
#define mp make_pair
#define debug(a) cout << #a << ": " << a << endl
#define debug1(a, l, r) FR(i, l, r) cout << a[i] << " "; cout << endl
#define SET(a, b) memset(a, b, sizeof(a));
#define refresh fflush(stdout);
#define digits(n) (int)(log10(n) + 1)
  
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vl;
typedef vector <pii> vii;
typedef vector <pll> vll;
    
const int INF = 0x3f3f3f3f;
const int LINF = 0x3f3f3f3f3f3f3f3f;
    
template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
   
/*********** TEMPLATE ENDS HERE *************/

#define int long long

pii v[120];
int H[120];

main()
{
	IOS
	
	int n;
	cin >> n;
	
	for(int i = 1; i <= n; i++)
		cin >> v[i].F >> v[i].S >> H[i];
	
	for(int i = 0; i <= 100; i++)
		for(int j = 0; j <= 100; j++)
		{
			bool ok = 1;
			
			int h = abs(v[1].F - i) * 1LL + abs(v[1].S - j) + H[1];
			for(int k = 2; k <= n && ok; k++)
				if(H[k] != 0 && abs(v[k].F - i) * 1LL + abs(v[k].S - j) * 1LL + H[k]) != h)
					ok = 0;
			
			if(ok == 1)
			{
				cout << i << ' ' << j << ' ' << h;
				return 0;
			}
		}
}

Compiler output:
a.cc:44:18: warning: overflow in conversion from 'long int' to 'int' changes value from '4557430888798830399' to '1061109567' [-Woverflow]
   44 | const int LINF = 0x3f3f3f3f3f3f3f3f;
      |                  ^~~~~~~~~~~~~~~~~~
a.cc:56:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   56 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:73:103: error: expected primary-expression before '!=' token
   73 |                                 if(H[k] != 0 && abs(v[k].F - i) * 1LL + abs(v[k].S - j) * 1LL + H[k]) != h)
      |                                                                                                       ^~
Language: C++


#include <string>
#include <vector>
#include <algorithm>

using namespace std;

class Puzzle 
{
public:
	int N;
	const int XMAX = 100;
	const int YMAX = 100;
	vector<int> Xs;
	vector<int> Ys;
	vector<int> Hs;

	void input()
	{
		int x, y, h;

		cin >> N;

		for (int ni = 0; ni < N; ni++) {
			cin >> x >> y >> h;
			Xs.push_back(x);
			Ys.push_back(y);
			Hs.push_back(h);
		}

	}

	void play()
	{
		int h1 = 1;
		int diff_0;
		int diff;
		int flag = 0;

		for (int xi = 0; xi <= XMAX; xi++) {
			for (int yi = 0; yi <= YMAX; yi++) {
				flag = 0;
				diff_0 = h1 - abs(Xs[0] - xi) - abs(Ys[0] - yi) - Hs[0];
				for (int hi = 1; hi < N; hi++) {
					diff = h1 - abs(Xs[hi] - xi) - abs(Ys[hi] - yi) - Hs[hi];
					if (diff_0 != diff) {
						flag = 1;
						break;
					}
				}
				if (flag == 0) {
					cout << xi << " " << yi << " " << h1-diff;
					return;
				}
			}
		}


	}
};


int main()
{
	Puzzle puz;

	puz.input();
	puz.play();

	return 0;
}



Compiler output:
a.cc: In member function 'void Puzzle::input()':
a.cc:22:17: error: 'cin' was not declared in this scope
   22 |                 cin >> N;
      |                 ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | 
a.cc: In member function 'void Puzzle::play()':
a.cc:52:41: error: 'cout' was not declared in this scope
   52 |                                         cout << xi << " " << yi << " " << h1-diff;
      |                                         ^~~~
a.cc:52:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
#include <fstream>
#include <vector>
#include <bitset>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <math.h>
#include <iomanip>
 
using namespace std;
  
/********** TEMPLATE STARTS HERE ***********/
    
#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define test int t; cin >> t; while(t--)
#define skip continue
#define stop break
#define sz(v) (int)v.size()
#define endl '\n'
#define PI 3.1415926535897932384626433832795
#define EPS 1e-9
#define gcd __gcd 
#define mp make_pair
#define debug(a) cout << #a << ": " << a << endl
#define debug1(a, l, r) FR(i, l, r) cout << a[i] << " "; cout << endl
#define SET(a, b) memset(a, b, sizeof(a));
#define refresh fflush(stdout);
#define digits(n) (int)(log10(n) + 1)
  
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vl;
typedef vector <pii> vii;
typedef vector <pll> vll;
    
const int INF = 0x3f3f3f3f;
const int LINF = 0x3f3f3f3f3f3f3f3f;
    
template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
   
/*********** TEMPLATE ENDS HERE *************/

#define int long long

pii v[120];
int H[120];

main()
{
	IOS
	
	int n;
	cin >> n;
	
	for(int i = 1; i <= n; i++)
		cin >> v[i].F >> v[i].S >> H[i];
	
	for(int i = 0; i <= 100; i++)
		for(int j = 0; j <= 100; j++)
		{
			bool ok = 1;
			
			int h = abs(v[1].F - i) + abs(v[1].S - j) + H[1];
			for(int k = 2; k <= n && ok; k++)
				if(H[k] != 0 && int(abs(v[k].F - i) + abs(v[k].S - j) + H[k]) != h)
					ok = 0;
			
			if(ok == 1)
			{
				cout << i << ' ' << j << ' ' << h;
				return 0;
			}
		}
}

Compiler output:
a.cc:44:18: warning: overflow in conversion from 'long int' to 'int' changes value from '4557430888798830399' to '1061109567' [-Woverflow]
   44 | const int LINF = 0x3f3f3f3f3f3f3f3f;
      |                  ^~~~~~~~~~~~~~~~~~
a.cc:56:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   56 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:51:13: error: expected primary-expression before 'long'
   51 | #define int long long
      |             ^~~~
a.cc:73:49: note: in expansion of macro 'int'
   73 |                                 if(H[k] != 0 && int(abs(v[k].F - i) + abs(v[k].S - j) + H[k]) != h)
      |                                                 ^~~
a.cc:73:48: error: expected ')' before 'long'
   73 |                                 if(H[k] != 0 && int(abs(v[k].F - i) + abs(v[k].S - j) + H[k]) != h)
      |                                   ~            ^
      |                                                )
Language: C++

#include <bits/stdc++.h>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const long double EPS = 10e-10;

int main(){
    int n;
    cin >> n;
    ll x[n], y[n] h[n];
    rep(n){
        cin >> x[i] >> y[i] >> h[i];
    }

    Pll C = Pii(0, 0);
    while(C.first <= 100){
        C.second = 0;
        while(C.second<= 100){
            bool ok = true;
            ll H = h[0] + abs(C.first-x[0]) + abs(C.second-y[0]);
            for(int i=1;i<n;i++){
                if(H-abs(C.first-x[i])-abs(C.second-y[i]) != h[i]){
                    ok = false;
                    break;
                }
            }
            if(ok){
                cout << C.first << " " << C.second << " " << H << endl;
                return 0;
            }
            C.second++;
        }
        C.first++;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: expected initializer before 'h'
   22 |     ll x[n], y[n] h[n];
      |                   ^
a.cc:24:24: error: 'y' was not declared in this scope
   24 |         cin >> x[i] >> y[i] >> h[i];
      |                        ^
a.cc:24:32: error: 'h' was not declared in this scope
   24 |         cin >> x[i] >> y[i] >> h[i];
      |                                ^
a.cc:32:20: error: 'h' was not declared in this scope
   32 |             ll H = h[0] + abs(C.first-x[0]) + abs(C.second-y[0]);
      |                    ^
a.cc:32:60: error: 'y' was not declared in this scope
   32 |             ll H = h[0] + abs(C.first-x[0]) + abs(C.second-y[0]);
      |                                                            ^
Language: C++

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

int main() {
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());

    int n; // <= 100
    cin >> n;

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

    for (int cx = 0; cx <= 100; cx++) {
        for (int cy = 0; cy <= 100; cy++) {
            bool isTop = true;
            // 一つめの点と比較して高さを決定
            long ch = h[0] + abs(cx-x[0]) + abs(cy-y[0]);

            for (int i = 1; i < n; i++) {
                if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i])), 0) {
                    isTop = false;
                    break;
                }
            }

            if(isTop == true) {
                cout << cx << " " << cy << " " << ch << endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: no matching function for call to 'max(long int)'
   24 |                 if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i])), 0) {
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:   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:
/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:24:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   24 |                 if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i])), 0) {
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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 <bits/stdc++.h>
using namespace std;

int main() {
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());

    int n; // <= 100
    cin >> n;

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

    for (int cx = 0; cx <= 100; cx++) {
        for (int cy = 0; cy <= 100; cy++) {
            bool isTop = true;
            // 一つめの点と比較して高さを決定
            long ch = h[0] + abs(cx-x[0]) + abs(cy-y[0]);

            for (int i = 1; i < n; i++) {
                if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i]), 0)) {
                    isTop = false;
                    break;
                }
            }

            if(isTop == true) {
                cout << cx << " " << cy << " " << ch << endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: no matching function for call to 'max(long int, int)'
   24 |                 if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i]), 0)) {
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:32: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   24 |                 if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i]), 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:
/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:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   24 |                 if (h[i] != max(ch - abs(cx-x[i]) - abs(cy-y[i]), 0)) {
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
using namespace std;

int main()
{   
    int n;
    cin>>n;
    int x[n],y[n],h[n],a[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i]>>h[i];
    }
    for(int i=0;i<=100;i++){
        for(int j=0;j<=100;j++){
            for(int k=0;k<n;k++){
                a[k]=abs(x[k]-i)+abs(y[k]-j)+h[k];
                if(k!=0&&a[k]!=a[k-1]&&h[i]!=0) break;
                else if(k==n-1){
                    cout<<i<<" "<<j<<" "<<a[k]<<endl;
                    return 0;
                }
            }
        }
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:18:21: error: 'cout' was not declared in this scope
   18 |                     cout<<i<<" "<<j<<" "<<a[k]<<endl;
      |                     ^~~~
a.cc:18:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:49: error: 'endl' was not declared in this scope
   18 |                     cout<<i<<" "<<j<<" "<<a[k]<<endl;
      |                                                 ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

/* Author rumoisen */
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
 
using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;
using namespace std;
int main()
{  
    int n,x[110],y[110],z[110];
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>x[i]>>y[i]>>z[i];
    }
    int a,b,c;
    bool flag=false;
    int l,m,n;
    for(int i=0;i<n;i++){
        for(a=0;a<=100;a++){
            for(b=0;b<=100;b++){
                for(c=1;;c++){
                    int takasa=max(c-max(x[i]-a,a-x[i])-max(y[i]-b,b-y[i]),0);
                    if(takasa==z[i]) l=a,m=b,n=c;
                }
            }
        }
    }
    cout<<l<<' '<<m<<' '<<n<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: redeclaration of 'int n'
   34 |     int l,m,n;
      |             ^
a.cc:27:9: note: 'int n' previously declared here
   27 |     int n,x[110],y[110],z[110];
      |         ^
Language: C++

//writer: Sakura
//name: Pyramid

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

int n;
struct Node{
	int x,y,h;
}a[105];

bool cmp(Node p,Node q){
	return p.h<q.h;
}

int main(){
	int flag=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d %d %d",&a[i].x,&a[i].y,&a[i].h);
	}
	sort(a+1,a+1+n,cmp);
	int hl,hn;
	for(int i=0;i<=100;i++){//横坐标
		for(int j=0;j<=100;j++){//纵坐标
			int cnt=1;
			for(int k=2;k<=n;k++){
				if(a[k].h>0){
					hl=abs(i-a[k-1].x)+abs(j-a[k-1].y)+a[k-1].h;
					hn=abs(i-a[k].x)+abs(j-a[k].y)+a[k].h;
					if(hl==hn)cnt++;
				}
				else{
					hn=0;
					if(hn==hl)cnt++;
				}
			}
			if(cnt==n){
				printf("%d %d %d\n",i,j,hn);s
				exit(0);
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:61: error: 's' was not declared in this scope
   43 |                                 printf("%d %d %d\n",i,j,hn);s
      |                                                             ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<utility>
#include<iostream>
#include<queue>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
 
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
 
 
int main()
{
    int n;
    int x[105]={};
    int y[105]={};
    long long int h[105]={};
    scanf("%d\n",&n);
    REP(i,n)scanf("%d %d %lld\n",&x[i],&y[i],&h[i]);
    long long int hhh;
    int judge;
    REP(xxx,101)
    {
        REP(yyy,101)
        {
            judge=1;
            hhh=h[0]+(xxx-x[0])*(xxx-x[0]>0?1:-1)+(yyy-y[0])*(yyy-y[0]>0?1:-1);
            REP(i,n)
            {
                if(h[i]+(xxx-x[i])*(xxx-x[i]>0?1:-1)+(yyy-y[i])*(yyy-y[i]>0?1:-1)!=hhh && j[i]!=0)judge=0;
            }
            if(judge==1)
            {
                printf("%d %d %lld\n",xxx,yyy,hhh);
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:91: error: 'j' was not declared in this scope
   34 |                 if(h[i]+(xxx-x[i])*(xxx-x[i]>0?1:-1)+(yyy-y[i])*(yyy-y[i]>0?1:-1)!=hhh && j[i]!=0)judge=0;
      |                                                                                           ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
  int n;
  cin >> n;
  vector<ll> x(n),y(n),h(n);
  for(int i = 0; i < n; i++){
    cin >> x[i] >> y[i] >> h[i];
  }
  if(n == 1){
    if(h[0] != 0){
      cout << x[0] << " " << y[0] << " " << h[0] << endl;
    }else{
      cout << x[0]+1 << " " << y[0] << " " << 1 << endl;
    }
    return 0;
  }

  for(ll Cx = 0; Cx <= 100; Cx++){
    for(ll Cy = 0; Cy <=100; Cy++){
      for(int i = 0; i < n; i++){
        ll H = h[i] + abs(x[i]-Cx) + abs(y[i]-Cy);
        if(H > 0) break;
      }
      for(int i = 0; i < n; i++){
        ll K = max(H - abs(x[i]-Cx) - abs(y[i]-Cy),(ll)0);
        if(K != h[i]) break;
        if(i == n-1){
          cout << Cx << " " << Cy << " " << H << endl;
          return 0;
        }
      }
    }
  }


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: 'H' was not declared in this scope
   46 |         ll K = max(H - abs(x[i]-Cx) - abs(y[i]-Cy),(ll)0);
      |                    ^
Language: C++

#include <cstdio>
#include <cstdlib>
#define NMAX 100
int Cx, Cy, H, N;
int x[NMAX], y[NMAX], h[NMAX];
int main(int argc, char const *argv[]) {
  scanf("%d\n", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d %d\n", &x[i], &y[i], &h[i]);
  }

  for (int cx = 0; cx <= 100; cx++) {
    for (int cy = 0; cy <= 100; cy++) {
      int sum = std::abs(x[0]-cx)+std::abs(y[0]-cy) + h[0];
      bool cisOK = true;
      for (int i = 1; i < N; i++) {
        if(sum != std::abs(x[i]-cx)+std::abs(y[i]-cy)+h[i]){
          if(sum - std::abs(x[i]-cx) - std::abs(y[i]-cy)) < 0 && h[i] == 0){
            continue;
          }
          cisOK = false;
          break;
        }
      }
      if(cisOK){
        Cx = cx;
        Cy = cy;
        H = sum;
        printf("%d %d %d\n", Cx, Cy, H);
      }
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:59: error: expected primary-expression before '<' token
   18 |           if(sum - std::abs(x[i]-cx) - std::abs(y[i]-cy)) < 0 && h[i] == 0){
      |                                                           ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
int H;
int main() {
	cin>>n;
	int x[n],y[n],h[n];
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i]>>h[i];
	}
	for(int i=0;i<101;i++){
		for(int j=0;j<101;j++){
			H=h[0]+abs(x[0]-i)+abs(y[0]-j);
			//cout<<H<<endl;
			for(int k=1;k<n;k++){
				if(H!=(h[k]+abs(x[k]-i)+abs(y[k]-j)){
					if(h[k]!=0||H<=(h[k]+abs(x[k]-i)+abs(y[k]-j)){
					//cout<<1;
					break;
					}
				}else if(k==n-1){
					cout<<i<<" "<<j<<" "<<H<<endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:69: error: expected ')' before '{' token
   18 |                                 if(H!=(h[k]+abs(x[k]-i)+abs(y[k]-j)){
      |                                   ~                                 ^
      |                                                                     )
a.cc:27:25: error: expected primary-expression before '}' token
   27 |                         }
      |                         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	
	ll n;cin >> n;
	vector<pair<pair<ll, ll>, ll>> v;
	
	REP(i,n){
		ll a, b, c;
		cin >> a >> b >> c;
		v.PB(MP(MP(a, b), c));
	}
	
	REP(i,101){
		REP(j,101){
			REP(k,n)if(v[k].SE != 0)ll now = v[k].SE + abs(j - v[k].FI.FI) + abs(i - v[k].FI.SE);
			bool flag = true;
			for(ll k = 0;k < n;k++){
				if(v[k].SE != 0 && now != v[k].SE + abs(j - v[k].FI.FI) + abs(i - v[k].FI.SE)){
					flag = false;
				}
			}
			
			if(flag && now > 0){
				cout << j << ' ' << i << ' ' << now << endl;
				return 0;
			}
			
		}
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:52: error: 'now' was not declared in this scope; did you mean 'pow'?
   42 |                                 if(v[k].SE != 0 && now != v[k].SE + abs(j - v[k].FI.FI) + abs(i - v[k].FI.SE)){
      |                                                    ^~~
      |                                                    pow
a.cc:47:36: error: 'now' was not declared in this scope; did you mean 'pow'?
   47 |                         if(flag && now > 0){
      |                                    ^~~
      |                                    pow