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

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

int main(){
    long i,n,fn;
    cin>>n;
    vector<long[3]> an(n);
    for(i = 0; i < n; i++){
        cin>>an[i][0]>>an[i][1]>>an[i][2];
    }
    long tx,ty,th;
    for(auto x:an){
        if(x[2]!=0){
            tx = x[0];
            ty = x[1];
            th = x[2];
            break;
        }
    }
    for(int i = 0; i <= 100; i++){
        for(int j = 0; j <= 100; j++){
            long h = an[th][2]+abs(an[tx][0]-i)+abs(an[ty][y]-j);
            bool jud=true;
            for(auto x:an){
                if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
                    jud=false;
                    break;
                }
            }
            if(jud){
                cout<<i<<" "<<j<<" "<<h;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:60: error: 'y' was not declared in this scope
   22 |             long h = an[th][2]+abs(an[tx][0]-i)+abs(an[ty][y]-j);
      |                                                            ^
a.cc:25:23: error: no matching function for call to 'max(long int, int)'
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:25:23: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:25:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
    long i,n,fn;
    cin>>n;
    vector<long[3]> an(n);
    for(i = 0; i < n; i++){
        cin>>an[i][0]>>an[i][1]>>an[i][2];
    }
    long tx,ty,th;
    for(auto x:an){
        if(x[2]!=0){
            tx = x[0];
            ty = x[1];
            th = x[2];
            break;
        }
    }
    for(int i = 0; i <= 100; i++){
        for(int j = 0; j <= 100; j++){
            long h = x[th]+abs(x[tx]-i)+abs(x[ty]-j);
            bool jud=true;
            for(auto x:an){
                if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
                    jud=false;
                    break;
                }
            }
            if(jud){
                cout<<i<<" "<<j<<" "<<h;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: 'x' was not declared in this scope
   22 |             long h = x[th]+abs(x[tx]-i)+abs(x[ty]-j);
      |                      ^
a.cc:25:23: error: no matching function for call to 'max(long int, int)'
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:25:23: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:25:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   25 |                 if(max(h-abs(x[0]-i)-abs(x[1]-j),0)!=x[3]){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include <algorithm>
#include<string>
#include<cmath>
#include <functional>
using namespace std;
int R(int Cx, int Cy, int x, int y) {
	return abs(x - Cx) + abs(y - Cy);
}
int main(void) {
	int N,n;
	int ax, ay;
	long int h[100], ah = 0;
	bool flag = false;
	cin >> N;
	int x[100], y[100] = { 0 };
	for (int i = 0;i < N;i++)
		cin >> x[i] >> y[i] >> h[i];
	for (ax = 0;ax <= 100;ax++) {
		if (flag == true)
			break;
		for (ay = 0;ay <= 100;ay++) {
			bool f = true;
			if (flag == true)
				break;
			for (n = 0;i < Ni++) {
				if (h[n] != 0)
					break;
			}
			for (int i = 0;i < N;i++) {
				if (i!=n && h[i] !=0  && (long)(R(ax, ay, x[n], y[n]) - R(ax, ay, x[i], y[i])) != h[i] - h[n])
					f = false;
			}
			if (f == true) {
				cout << ax << " " << ay << " " << R(ax, ay, x[n], y[n]) + h[n];
				return 0;
			}
		}
	}

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:36: error: 'i' was not declared in this scope
   26 |                         for (n = 0;i < Ni++) {
      |                                    ^
a.cc:26:40: error: 'Ni' was not declared in this scope; did you mean 'N'?
   26 |                         for (n = 0;i < Ni++) {
      |                                        ^~
      |                                        N
a.cc:26:44: error: expected ';' before ')' token
   26 |                         for (n = 0;i < Ni++) {
      |                                            ^
      |                                            ;
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <unordered_set>
#include <cstdint>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int64_t> xs(n), ys(n), hs(n);
    for(int i=0; i<n; ++i){
        cin >> xs[i] >> ys[i] >> hs[i];
    }
    unordered_set<int64_t> result_set;
    for(int x=0; x<=100; ++x){
        for(int y=0; y<=100; ++y){
            unordered_set<int64_t> h_set;
            for(int i=0; i<n; ++i){
                h_set.insert(hs[i]+labs(xs[i]-x)+labs(ys[i]-y));
            }
            if(h_set.size()==1){
                for(auto h : h_set){
                    h_set.insert(h);
                }
            }
        }
    }
    for(auto h : h_set){
        h_set.insert(h);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: 'h_set' was not declared in this scope
   31 |     for(auto h : h_set){
      |                  ^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    ll n; ll x[105][3];// ll xx[10000][2];
    cin >> n;
    //int i = 0;
    for(int a = 0; a < n; a++){
        cin >> x[a][0] >> x[a][1] >> x[a][2];
        /*if(x[a][2] == 0){
            n--;
            a--;
            xx[i][0] = x[a][0];
            xx[i][0] = x[a][1];
            i++;
        }*/
    }

    for(int b = 0; b < 101; b++){
        for(int c = 0; c < 101; c++){
            int i = 0;
            while(true){
                ll h = x[i][2]+abs(x[i][1]-c)+abs(x[i][0]-b);  
                if(x[i][2] != 0)break;          
            }

            for(int d = 0; d < n; d++){
                if(x[d][2] != h-abs(x[d][1]-c)-abs(x[d][0]-b) && x[d][2] != 0)break;
                //for(int j = 0; j < i; j++)if(h-abs(xx[j][0]-c)-abs(xx[j][1]-d) != 0)goto A;
                if(d == n-1){
                    cout << b << ' ' << c << ' ' << h << endl;
                    return 0;
                }
                
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: 'h' was not declared in this scope
   31 |                 if(x[d][2] != h-abs(x[d][1]-c)-abs(x[d][0]-b) && x[d][2] != 0)break;
      |                               ^
a.cc:34:53: error: 'h' was not declared in this scope
   34 |                     cout << b << ' ' << c << ' ' << h << endl;
      |                                                     ^
Language: Java

import java.util.*;

class Main
{
    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];
        long[] h = new long[N];
        
        int cnth = 0;
        for(int i = 0; i < N; i++){
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            h[i] = sc.nextLong();
            if(h[i] > 0){
                cnth++;
            }
        }

        boolean bl = false;
        int ansx = 0;
        int ansy = 0;
        long ansh = 0;
        for(int cx = 0; cx <= 100; cx++){
            for(int cy = 0; cy <= 100; cy++){
                bl = true;
                int index = -1;
                for(int i = 0; i < N; i++){
                    if(h[i] > 0){
                        index = i;
                    }
                }

                long H = h[index] + Math.abs(x[index] - cx) + Math.abs(y[index] - cy);

                for(int i = 0; i < N; i++){
                    if( h[i] != Math.max(0, H -  Math.abs(x[i] - cx) - Math.abs(y[i] - cy))){
                        bl = false;
                        break;
                    }
                }
                if(bl == true){
                    ansx = cx;
                    ansy = cy;
                    ansh = H;
                    break;
                }
            }
        }
        System.out.println(ansx + " " + ansy + " " + ansh);
    }


Compiler output:
Main.java:54: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char* argv[]) {
    int N;
    std::cin >> N;

    auto x = new int[N];
    auto y = new int[N];
    auto h = new int[N];

    int hmin = 1000000001;
    int hmax = 0;
    for (int i = 0; i < N; i++) {
        std::cin >> x[i] >> y[i] >> h[i];
        if (hmin > h[i]) hmin = h[i];
        if (hmax < h[i]) hmax = h[i];
    }

#if 0
    auto v1 = std::max(1 , hmin - 200);
    for (int H = 1; H <= 1000000000; H++) {
        for (int cx = 0; cx <= 100; cx++) {
            for (int cy = 0; cy <= 100; cy++) {
                bool ok = false;
                for (int i = 0; i < N; i++) {
                    auto v = std::max(H - abs(x[i] - cx) - abs(y[i] - cy), 0);
                    if (h[i] == v) ok = true;
                    else {
                        ok = false;
                        break;
                    }
                }
                if (ok) {
                    std::cout << cx << " " << cy << " " << H << std::endl;
                    return 0;
                }
            }
        }
    }
#else
    for (int cx = 0; cx <= 100; cx++) {
        for (int cy = 0; cy <= 100; cy++) {

            int index = 0;
            int H = 0;
            for (int i = 0; i < N; i++) {
                if (h[i] != 0) {
                    H = h[i] + abs(x[i] - cx) + abs(y[i] - cy);
                    index = i;
                }
            }

            bool ok = false;
            for (int i = 0; i < N; i++) {
                if (h[i] != 0) {
                    if (H == h[i] + abs(x[i] - cx) + abs(y[i] - cy))
                        ok = true;
                    else {
                        ok = false;
                        break;
                    }
                } else {
                    if (H - abs(x[i] - cx) - abs(y[i] - cy) < 0))
                        ok = true;
                    else {
                        ok = false;
                        break;
                    }
                }
            }
            if (ok) {
                std::cout << cx << " " << cy << " " << H << std::endl;
                return 0;
            }
        }
    }
#endif

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:66:65: error: expected primary-expression before ')' token
   66 |                     if (H - abs(x[i] - cx) - abs(y[i] - cy) < 0))
      |                                                                 ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	ll x[n], y[n], h[n];
	rep(i, n) {
		cin >> x[i] >> y[i] >> h[i];
	}
	int ansx = 0, ansy = 0, ansh = 1, ah = 1;
	bool flag, init;
	rep(i, 101)
	{
		rep(j, 101)
		{
			flag = true;
			init = true;
			rep(k, n)
			{
				if (h[k] != 0)
				{
					if (init)
					{
						ah = h[k] + abs(x[k] - i) + abs(y[k] - j);
						init = false;
					}
					else
					{
						if (h[k] != max(0, ah - abs(x[k] - i) - abs(y[k] - j))) {
							flag = false;
						}
					}
				}
			}
			if (flag) {
				ansx = i;
				ansy = j;
				ansh = ah;
			}
		}

	}
	cout << ansx << " " << ansy << " " << ansh << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
    7 |         ll x[n], y[n], h[n];
      |         ^~
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         rep(i, n) {
      |             ^
a.cc:8:9: error: 'rep' was not declared in this scope
    8 |         rep(i, n) {
      |         ^~~
Language: C++

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

int high(int H, int x, int y, int cx, int cy);
int main()
{
	int N;
	int CX, CY, H;
	cin >> N;
	vector<int> x;
	vector<int> y;
    vector<int> h;

    for(int i=0; i<N; i++)
    {
    	int a,b,c;
    	cin >> a >> b >> c;
    	x.push_back(a);
    	y.push_back(b);
    	h.push_back(c);
    }

    int M = *max_element(h.begin(), h.end());
    vector<int>::iterator maxIt = max_element(h.begin(), h.end());
    size_t maxIndex = distance(h.begin(), maxIt);
    
    bool flag = true;
            
    else{
    	for(int i=0;i<=100;i++)
    	{
    		for(int j=0;j<=100;j++)
    		{
    			flag = true;
    			H = h[maxIndex] 
    			    + abs(x[maxIndex]-i)
    			    + abs(y[maxIndex]-j);
    			for(int k=0; k<N; k++)
    			{
                     if(h[k]!=high(H,x[k],y[k],i,j))
                     { 
                       flag = false;
                       break;
                     }
    			}
    			if(flag==true)
    			{
    				CY = j;
    				break;
    			}
    		}
    		if(flag==true)
    		{
    		    CX = i; 
    			break;
    		}
    	}
    } 

    cout << CX << " " << CY << " " << H << endl;

	return 0;
}

int high(int H, int x, int y, int cx, int cy)
{
	return max(H-abs(x-cx)-abs(y-cy),0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: 'else' without a previous 'if'
   32 |     else{
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	ll x[n], y[n], h[n];
	rep(i, n) {
		cin >> x[i] >> y[i] >> h[i];
	}
	int ansx = 0, ansy = 0, ansh = 1, ah = 1;
	bool flag, init;
	rep(i, 101)
	{
		rep(j, 101)
		{
			flag = true;
			init = true;
			rep(k, n)
			{
				if (h[k] != 0)
				{
					if (init)
					{
						ah = h[k] + abs(x[k] - i) + abs(y[k] - j);
						init = false;
					}
					else
					{
						if (h[k] != max(0, ah - abs(x[k] - i) - abs(y[k] - j))) {
							flag = false;
						}
					}
				}
			}
			if (flag) {
				ansx = i;
				ansy = j;
				ansh = ah;
			}
		}

	}
	cout << ansx << " " << ansy << " " << ansh << endl;
	return 0;
}
#include<stdio.h>
int main()
{
	int n, m, ans = -1;
	scanf("%d%d", &n, &m);
	for (int i = m / n; i>0 && ans == -1; i--) {
		if (m%i == 0 && ans == -1)ans = i;
	}
	printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
    7 |         ll x[n], y[n], h[n];
      |         ^~
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         rep(i, n) {
      |             ^
a.cc:8:9: error: 'rep' was not declared in this scope
    8 |         rep(i, n) {
      |         ^~~
a.cc: At global scope:
a.cc:48:5: error: redefinition of 'int main()'
   48 | int main()
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main()
      |     ^~~~
Language: C++

//#include <bits/stdc++.h>
#include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e10;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }

signed main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n), h(n);
  rep(i, n) cin >> x[i] >> y[i] >> h[i];

  rep(cx, 101) {
    rep(cy, 101) {
      set<int> H;
      rep(i, n) {
        if (h[i] != 0) {
          int tmp = h[i] + abs(x[i] - cx) + abs(y[i] - cy);
          H.insert(tmp);
        }
      }
      // cout << H.size() << endl;
      if (H.size() == 1) {
        bool flag = true;
        rep(i, n) if (h[i] != max(*H.begin() - abs(x[i] - cx) - abs(y[i] - cy), 0LL)) flag = false;
        if (falg) {
          cout << cx << ' ' << cy << ' ' << *H.begin() << endl;
          return 0;
        }
      }
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:13: error: 'falg' was not declared in this scope; did you mean 'flag'?
   41 |         if (falg) {
      |             ^~~~
      |             flag
Language: C

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

int main()
{
    int n,i,j=0,k=0,cnt,p,yan=0,xan=0;
    long x[101],y[101],h[101],max=0,xma[101],yma[1101];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%ld%ld%ld",&x[i],&y[i],&h[i]);
    }
    for(1=0;i<n;i++){
        if(h[i]>max){
            max=h;
            j=i;
            cnt=0;
        }else{
            if(h[i]==max){
                cnt++;
            }
        }
    }
    if(cnt==0){
        printf("%ld %ld %ld",x[j],y[j],h[j]);
    }else{
        for(i=0;i<n;i++){
            if(h[i]==max){
                xma[k]=x[i];
                yma[k]=y[i];
                k++;
            }
        }
        for(i=0;i<k;i++){
            xan+=xma;
            yan+=yma;
        }
        xan/=k;
        yan/=k;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:10: error: lvalue required as left operand of assignment
   13 |     for(1=0;i<n;i++){
      |          ^
main.c:15:16: error: assignment to 'long int' from 'long int *' makes integer from pointer without a cast [-Wint-conversion]
   15 |             max=h;
      |                ^
main.c:35:16: error: assignment to 'int' from 'long int *' makes integer from pointer without a cast [-Wint-conversion]
   35 |             xan+=xma;
      |                ^~
main.c:36:16: error: assignment to 'int' from 'long int *' makes integer from pointer without a cast [-Wint-conversion]
   36 |             yan+=yma;
      |                ^~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define ll long long
struct Node{
    ll xi , yi , hp;
}inf[200];

ll hh(ll x , ll cx ,ll y ,ll cy ,ll H){
    return max(H - abs(x - cx) - abs(y - cy), 0ll);
}

int main()
{
    int N;
    scanf("%d",&N);
    for(int i = 0; i<N; i++){
        cin >> inf[i].xi >> inf[i].yi >> inf[i].hp;
    }
    ll ansH , ansx , ansy;
    ll tmpH;
    ll lo = 1ll ; ll hii = 1e15;
    ll tmplo = 1;
    for(int i = 0; i<=100; i++){
        for(int j = 0; j<=100; j++){
            tmplo = 0;
            while(tmplo < 1e11+200){
                ll hi = inf[0].hp;
                ll x = inf[0].xi ; ll y = inf[0].yi;
                tmpH = -1;
                lo = tmplo+1 , hii = 1e11+200;
                while(hii >= lo){
                    ll mid = (lo + hii)/2;
                    ll HH = hh(x , i , y , j , mid);
                    if(HH == hi){
                        tmpH = mid;
                        hii = mid - 1;
                    }
                    if(HH > hi){
                        hii = mid - 1;
                    }
                    else lo = mid + 1;
                }
                if(tmpH != -1){
                    int co = 0;
                    for(int k = 0; k<N; k++){
                        if(hh(inf[k].xi , i , inf[k].yi , j , tmpH) == inf[k].hp)co++;
                        else break;
                    }
                    if(co == N){
                        ansx = i; ansy = j; ansH = tmpH;
                        goto xxx;
                    }
                    tmplo = mid;
                }
                else break;
            }
        }
    }
    xxx:
    cout << ansx << " " << ansy << " " << ansH << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:29: error: 'mid' was not declared in this scope
   55 |                     tmplo = mid;
      |                             ^~~
Language: C++

#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
struct Point{
  long x;
  long y;
  long h;
};
long distance(int x1,int y1,int x2,int y2){
  return abs(x1-x2) + abs(y1-y2);
}
int main(){
  long n;
  vector<Point> pnt;
  cin >> n;
  pnt.resize(n);
  long ii,xx,yy;

  for(ii=0;ii<n;ii++){
	cin  >> pnt[ii].x >> pnt[ii].y >> pnt[ii].h;
  }
  
  Point first= pnt[0];
  long dist,height;

  for(xx=0;xx<=100;xx++){
	for(yy=0;yy<=100;yy++){

	  for(ii=0;ii<n;ii++){
		dist = distance(xx,yy,pnt[ii].x,pnt[ii].y);
		if(pnt[ii].h != 0){
		  height = pnt[ii].h + dist;
		  break;
		}
	  }
	  
	  //中心がxx yyの時、矛盾がないかを確認する
	  //dist = distance(xx,yy,first.x,first.y);


	  //

	  for(ii=0;ii<n;ii++){
		dist = distance(xx,yy,pnt[ii].x,pnt[ii].y);
//		if(  ((pnt[ii].h - dist) >= 0 &&
//			  (pnt[ii].h + dist) == height) ||
//			 ((pnt[ii].h -dist) < 0)
//			 )
//			{
//		  
//		}
		if (((pnt[ii].h - dist) >= 0 &&
			 (pnt[ii].h + dist) == height)
			||
			pnt[ii].h -dist < 0
		  {
		  
		}		
		else{
		  break;
		}
	  }
	  
	  if(ii == n){
		goto res;
	  }
	  
	}
  }
 res:
  //cout << "xx:" << xx << "yy:" << yy;
  cout << xx << " " << yy <<" " << height ;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:44: error: expected ')' before '{' token
   65 |                         pnt[ii].h -dist < 0
      |                                            ^
      |                                            )
   66 |                   {
      |                   ~                         
a.cc:62:20: note: to match this '('
   62 |                 if (((pnt[ii].h - dist) >= 0 &&
      |                    ^
a.cc:72:11: error: expected primary-expression before '}' token
   72 |           }
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include<climits>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////


ll N;
ll h[111][111];
int x[111],y[111];

int sub(int &x1,int &y1,int &x2,int &y2){
    return (x1>x2?x1-x2:x2-x1)+(y1>y2?y1-y2:y2-y1);
}

int main(){
    scanf("%lld",&N);
    fornum(i,0,111){
        fornum(j,0,111){
            h[i][j]=-1;
        }
    }
    fornum(i,0,N){
        scanf("%d%d",&x[i],&y[i]);
        scanf("%lld",&h[x[i]][y[i]]);
    }
    /*
    fornum(i,0,6){
        fornum(j,0,6){
            printf("%lld ",h[i][j]);
        }
        printf("\n");
    }
    */
    fornum(i,0,101){
        fornum(j,0,101){
            int flag=1;
            ll checkh=h[x[0]][y[0]]+sub(i,j,x[0],y[0]);

            fornum(k,1,N){
                if(h[x[k][y[k]]==0&&sub(i,j,x[k],y[k])<=checkh)
                    continue;
                if(checkh!=h[x[k]][y[k]]+sub(i,j,x[k],y[k])){
                    
                    flag=0;
                    break;
                }

            }
            /*
            fornum(k,0,101){
                fornum(l,0,101){
                    if(checkh==-1){
                        if(h[k][l]==-1)
                            continue;
                        else
                            checkh=h[k][l]+sub(i,j,k,l);
                    }
                    if(h[k][l]!=-1&&checkh!=h[k][l]+sub(i,j,k,l)){
                        flag=0;
                        break;
                    }
                }
                if(flag==0)
                    break;
            }
            */
            if(flag==1){
                printf("%d %d %lld",i,j,checkh);
                return 0;
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:26: error: invalid types 'int[int]' for array subscript
   55 |                 if(h[x[k][y[k]]==0&&sub(i,j,x[k],y[k])<=checkh)
      |                          ^
a.cc:55:63: error: expected ']' before ')' token
   55 |                 if(h[x[k][y[k]]==0&&sub(i,j,x[k],y[k])<=checkh)
      |                                                               ^
      |                                                               ]
Language: C++

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

int main(){
    long i,n,fn;
    cin>>n;
    vector<long[3]> an(n);
    for(i = 0; i < n; i++){
        cin>>an[i][0]>>an[i][1]>>an[i][2];
    }
    for(int i = 0; i <= 100; i++){
        for(int j = 0; j <= 100; j++){
            bool jud=true,first=true;
            long cx,cy,H;
            for(auto x:an){
                long r = x[2]+abs(x[0]-i)+abs(x[1]-j);
                if(first){
                    cx=i;
                    cy=j;
                    H=r;
                    first = false;
                }
                if(x[2]==0&&abs(x[0]-i)+abs(x[1]-j)>H)
                else if(r<H){
                    jud = false;
                    break;
                }
                
            }
            if(jud&&H!=0){
                cout<<cx<<" "<<cy<<" "<<H;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: expected primary-expression before 'else'
   24 |                 else if(r<H){
      |                 ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include<climits>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////


ll N;
ll h[111][111];
int x[111],y[111];

int sub(int &x1,int &y1,int &x2,int &y2){
    return (x1>x2?x1-x2:x2-x1)+(y1>y2?y1-y2:y2-y1);
}

int main(){
    scanf("%lld",&N);
    fornum(i,0,111){
        fornum(j,0,111){
            h[i][j]=-1;
        }
    }
    fornum(i,0,N){
        scanf("%d%d",&x[i],&y[i]);
        scanf("%lld",&h[x[i]][y[i]]);
    }
    /*
    fornum(i,0,6){
        fornum(j,0,6){
            printf("%lld ",h[i][j]);
        }
        printf("\n");
    }
    */
    fornum(i,0,101){
        fornum(j,0,101){
            int flag=1;
            ll checkh=h[x[0]][y[0]]+sub(i,j,x[0],y[0]);

            fornum(k,1,N){
                if(h[x[k][y[k]]]==0&&sub(i,j,x[k],y[k])<=checkh)
                    continue;
                if(checkh!=h[x[k]][y[k]]+sub(i,j,x[k],y[k])){
                    
                    flag=0;
                    break;
                }

            }
            /*
            fornum(k,0,101){
                fornum(l,0,101){
                    if(checkh==-1){
                        if(h[k][l]==-1)
                            continue;
                        else
                            checkh=h[k][l]+sub(i,j,k,l);
                    }
                    if(h[k][l]!=-1&&checkh!=h[k][l]+sub(i,j,k,l)){
                        flag=0;
                        break;
                    }
                }
                if(flag==0)
                    break;
            }
            */
            if(flag==1){
                printf("%d %d %lld",i,j,checkh);
                return 0;
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:26: error: invalid types 'int[int]' for array subscript
   55 |                 if(h[x[k][y[k]]]==0&&sub(i,j,x[k],y[k])<=checkh)
      |                          ^
Language: C++

#include <iostream>
using namespace std;

int sa(int n,int m){
    if(n-m>0)return n-m;
    else return m-n;
}
int main() {
	int num,ki,kih;
	int ax,ay,ah;
	bool ck=true;
	cin>>num;
	int x[num],y[num],h[num];
	for(int i=0;i<num;i++){
	    cin>>x[i]>>y[i]>>h[i];
	}
	for(int j=0;j<num;j++){
	   if(h[j]!=0){
	       ki=j;
	       break;
	   }
	}
	for(int x0=0;x0<=100;x0++){
	    for(int y0=0;y0<=100;y0++){
	        
	        ck=true;
	        for(int k=0;k<num;k++){
	            kih=h[ki]+sa(x[ki],x0)+sa(y[ki],y0)-sa(x[k],x0)-sa(y[k],y0);
	            if(kih==h[k]||(kih<0&&h[k]==0){}
	            else ck=false;
	        }
	        if(ck){
	            ax=x0;
	            ay=y0;
	            ah=h[ki]+sa(x[ki],x0)+sa(y[ki],y0);
	            
	        }
	        
	    }
	}
	cout<<ax<<" "<<ay<<" "<<ah;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:51: error: expected ';' before '{' token
   29 |                     if(kih==h[k]||(kih<0&&h[k]==0){}
      |                                                   ^
      |                                                   ;
a.cc:30:21: error: expected primary-expression before 'else'
   30 |                     else ck=false;
      |                     ^~~~
a.cc:29:53: error: expected ')' before 'else'
   29 |                     if(kih==h[k]||(kih<0&&h[k]==0){}
      |                       ~                             ^
      |                                                     )
   30 |                     else ck=false;
      |                     ~~~~
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++;
    }

    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:36:7: error: 'flag' was not declared in this scope
   36 |       flag=true;
      |       ^~~~
Language: Java

import java.util.*;
import java.math.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
		String result ="";

		switch (n){
			case 2:

				int x = sc.nextInt();
				int y = sc.nextInt();
				int h = sc.nextInt();
				int xx = sc.nextInt();
				int yy = sc.nextInt();
				int hh = sc.nextInt();

				if(Math.abs(hh-h)==Math.abs(yy-y)-Math.abs(xx-x)){
					System.out.println("0 0 " + Math.max(hh,h));
				}


			break;

			case 3:
			break;

			case 4:

			
			for(int i=0;i<4;i++){
				int x = sc.nextInt();
				int y = sc.nextInt();
				int h = sc.nextInt();

			}





			break;
			default:

		}
		



		List<Integer> oddList = new ArrayList<>();
		List<Integer> evenList = new ArrayList<>();

		for(int i=0;i<n;i=i+2){
			oddList.add(sc.nextInt());
			evenList.add(sc.nextInt());
		}
		Collections.sort(oddList);
		Collections.sort(evenList);


		// System.out.println("log");
		// System.out.println(oddMap);
		// System.out.println(evenMap);

	}

}

Compiler output:
Main.java:35: error: variable x is already defined in method main(String[])
				int x = sc.nextInt();
				    ^
Main.java:36: error: variable y is already defined in method main(String[])
				int y = sc.nextInt();
				    ^
Main.java:37: error: variable h is already defined in method main(String[])
				int h = sc.nextInt();
				    ^
3 errors
Language: C++

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


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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: conflicting declaration 'int h'
   14 | int cx,cy,h;
      |           ^
a.cc:10:19: note: previous declaration as 'int h [100]'
   10 | int x[100],y[100],h[100];
      |                   ^
a.cc:25:2: error: incompatible types in assignment of 'int' to 'int [100]'
   25 | h=height;
      | ~^~~~~~~
Language: C++

#include "bits/stdc++.h"

#define MOD 1000000007
#define pb push_back
#define all(v) (v.begin(), v.end());
#define ff first
#define ss second
#define db(x) cerr << #x << " = "  << x << '\n'
#define ooo cerr << "---------------------\n"

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> iil;

ll x[1111], y[1111], h[1111];
void goooooo()
{
	int n;
	cin >> n;
	for(int i = 1; i <= n; i ++)
		cin >> x[i] >> y[i] >> h[i];
	for(ll cx = 0; cx <= 100; cx ++)
	for(ll cy = 0; cy <= 100; cy ++)
	{
		set<ll> s;
		for(int i = 1; i <= n; i ++)
		{
			ll k = abs(x[i] - cx) + abs(y[i] - cy);
			ll r = k;
			ll hh = k + h[i];
				s.insert(hh);
		}
		ll z = 0;
		for(auto it : s)
			z = it;
		if(s.size() == 1 && z > 0)
		{
			cout << cx << ' ' << cy << ' ' << z;
			return;
		}
	}
}

int main()
{
	int abcdefghijklmnopqrstuvwxyz = 1;
//	cin >> abcdefghijklmnopqrstuvwxyz;
	for(;abcdefghijklmnopqrstuvwxyz;abcdefghijklmnopqrstuvwxyz --)
		goooooo();
	getchar();
	getchar();
}y67

Compiler output:
a.cc:54:2: error: 'y67' does not name a type
   54 | }y67
      |  ^~~
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){
            cout << cx << " " << cy << " " << ch << endl;
            return 0;
            }
        }
    }
    return 0;
}

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

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

typedef long long int llint;

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

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


  for(int i = 0; i <= 100; i++) {
    for(int j = 0; j <= 100; j++) {
       
      int ch = abs(j - x[0]) + abs(i - y[0]) + h[0];
      if(ch <= 0) continue;
      
      bool flg = true;
      for(int k = 1; k < n; k++) {
	int tmp = ch - abs(j - x[k]) - abs(i - y[k]);
	if(tmp > 0 && tmp != h[k]) flg = false;
	if(tmp =< 0 && h[k] != 0) flg = false;
	if(!flg) break;
      }
      
      if(flg) {
	cout<< j << ' ' << i << ' ' << ch <<endl;
	return 0;
      }
	
    }
  }
  
  

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: expected primary-expression before '<' token
   29 |         if(tmp =< 0 && h[k] != 0) flg = false;
      |                 ^
Language: C++



#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;
int main()
{
	string str;
	getline(cin, str);
	int N = stoi(str);
	vector <int> x;
	vector <int> y;
	vector <int> h;
	x.resize(N);
	y.resize(N);
	h.resize(N);

	for (int i = 0; i < N; i++) {
		getline(cin, str);
		istringstream iss(str);
		iss >> str;
		x[i] = stoi(str);
		iss >> str;
		y[i] = stoi(str);
		iss >> str;
		h[i] = stoi(str);
	}
	int minx = *min_element(x.begin(), x.end());
	int miny = *min_element(y.begin(), y.end());
	int minh = *min_element(h.begin(), h.end());
	int maxx = *max_element(x.begin(), x.end());
	int maxy = *max_element(y.begin(), y.end());
	int maxh = *max_element(h.begin(), h.end());

	for (int i = 0; i < N; i++) {
		h[i] = h[i] - minh;
	}



	int cx_ = -1;
	int cy_ = -1;
	int H_ = -1;

	int cx_min = N >= 3 ? 0 : minx;
	int cx_max = N >= 3 ? 100 : maxx;
	int cy_min = N >= 3 ? 0 : miny;
	int cy_max = N >= 3 ? 100 : maxx;
	int H_max = H + maxH > 1e9 : 1e9 - maxH : 100;

	for (int cx = cx_min; cx <= cx_max; cx++) {
		for (int cy = cy_min; cy <= cy_max; cy++) {

			for (int H = 0; H <= H_max; H++) {
				int ok = 1;
				for (int i = 0; i < N; i++) {
					if (h[i] + minh != max(H + minh  - abs(x[i] - cx) - abs(y[i] - cy), 0)) {
						ok = 0;
						break;
					}
				}
				if (ok == 1) {
					if (H_ < H) {
						cx_ = cx;
						cy_ = cy;
						H_ = H;
					}
				}
			}
		}
	}
	cout << cx_ << " " << cy_ << " " << H_ + minh << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:21: error: 'H' was not declared in this scope
   54 |         int H_max = H + maxH > 1e9 : 1e9 - maxH : 100;
      |                     ^
a.cc:54:25: error: 'maxH' was not declared in this scope; did you mean 'maxh'?
   54 |         int H_max = H + maxH > 1e9 : 1e9 - maxH : 100;
      |                         ^~~~
      |                         maxh
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
	long n;
	cin >> n;
	vector<long> x(n), y(n), h(n);
	for (long i=0;i<n;++i) {
		cin >> x[i] >> y[i] >> h[i];
	}
	for (long cx=0;cx<=100;++cx) {
		for (long cy=0;cy<=100;++cy) {
			vector<long> hs;
			for (long i=0;i<n;++i) {
				if (h[i] == 0) {
					continue;
				}
				hs.push_back(h[i]+abs(x[i]-cx)+abs(y[i]-cy));
			}
			if (hs.size() == 1) {
				auto itr = find_if(h.begin(),h.end(),[](long x){return x!=0});
				size_t idx = distance(h.begin(),itr);
				cout << x[idx] << ' ' << y[idx] << ' ' << h[idx] << endl;
			}
			sort(hs.begin(),hs.end());
			hs.erase(unique(hs.begin(),hs.end()),hs.end());
			if (hs.size() == 1) {
				cout << cx << ' ' << cy << ' ' << hs[0] << endl;
				return 0;
			}
		}
	}
	while(1);
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:26:92: error: expected ';' before '}' token
   26 |                                 auto itr = find_if(h.begin(),h.end(),[](long x){return x!=0});
      |                                                                                            ^
      |                                                                                            ;
Language: C++

#include<iostream>

using namespace std;

int main(){
int n,m,s=1000000000;cin>>n;n=m;
int x[200],y[200],h[200];
while(m--){cin>>x[m]>>y[m]>>h[m];s=min(s,h[m]);}
for(int i=0;i<=100;i++)
for(int j=0;j<=100;j++)
for(int k=s;k<=s+200;k++){
bool ok=true;
for(int l=0;l<n;l++)
if(max(0,k-abs(i-x[l])-(j-y[l]))-h[l]){ok=false;break;}

if(ok){cout<<i<<" "<<j<<" "<<k<<endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | 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;
    long long 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;
            }
            if(ch){
                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:27:33: error: no matching function for call to 'max(long long int, int)'
   27 |                     if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0))break;
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:27:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   27 |                     if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0))break;
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/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:27:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   27 |                     if(h[i]!=max(ch-abs(x[i]-cx)-abs(y[i]-cy),0))break;
      |                              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:33: error: 'h' was not declared in this scope
   29 |           cout<<x<<" "<<y<<" "<<h<<endl;
      |                                 ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int N,x[101],y[101],h[101],H=2e9;
int C[101][101] = {0};
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(h==0) H = min(a+b,H);
				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++){
			if(C[i][j]>0 && C[i][j]<=H){
				cout << i << " " << j << " " << C[i][j] << endl;
				return 0;
			}
			C[i][j] = 0;
		}
	}
	assert(H==1);
	for(int i=0;i<N;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(a+b==1) C[j][k]++;
			}
		}
	}
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			if(C[i][j]>=2){
				cout << i << " " << j << " " << 1 << endl;
				return 0;
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'assert' was not declared in this scope
   35 |         assert(H==1);
      |         ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include <cmath>
  +++ |+#include <cassert>
    4 | using namespace std;