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

#include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;

signed main(){
  int n;
  cin>>n;
  vector<int> x(n);
  vector<int> y(n);
  vector<int> 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++){
      bool f=true;
      int H=-1;
      for(int k=0;k<n;k++){
        if(H==-1&&h[k]>0){
          H=h[k]+abs(x[k]-i)+abs(y[k]-j);
        }else if(h[k]>0){
          if(max(0,H-abs(x[k]-i)-abs(y[k]-j))!=h[k])f=false;
        }
      }
      if(f&&H>0){
        cout<<i<<" "<<j<<" "<<H<<endl;
        return 0;
      }
    }
  }
}


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

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

typedef long long ll;
int x[101], y[101], h[101];

int main() {
    int n;
    cin >> n;
    tuple<ll, ll, ll> G = make_tuple(-1, -1, -1);
    for(int i=0; i<n; i++){
        ll tx, ty, th;
        cin >> x[i] >> y[i] >> h[i];
        if(th >= 1) G = make_tuple(x[i], y[i], h[i]);
    }

    for(ll cx=1; cx<=100; cx++){
        for(ll cy=1; cy<=100; cy++){
            ll pred_h = get<2>(G) + abs(get<0>(G) - cx) + abs(get<1>(G) - cy);
            bool flag = true;
            for(int i=0; i<n; i++){
                ll res = max(pred_h - abs(x[i] - cx) - abs(y[i] - cy), 0L);
                if(h[i] != res) flag = false;
            }
            if(flag){
                cout << cx << " " << cy << " " << pred_h << endl;
                return 0;
            }
        }
    }
}

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

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

typedef long long ll;
int x[101], y[101], h[101];

int main() {
    int n;
    cin >> n;
    tuple<ll, ll, ll> G = make_tuple(-1, -1, -1);
    for(int i=0; i<n; i++){
        ll tx, ty, th;
        cin >> x[i] >> y[i] >> h[i];
        if(th >= 1) G = make_tuple(x[i], y[i], h[i]);
    }

    for(ll cx=1; cx<=100; cx++){
        for(ll cy=1; cy<=100; cy++){
            ll pred_h get<2>(G) + abs(get<0>(G) - cx) + abs(get<1>(G) - cy);
            bool flag = true;
            for(int i=0; i<n; i++){
                ll res = max(pred_h - abs(x[i] - cx) - abs(y[i] - cy), 0L);
                if(h[i] != res) flag = false;
            }
            if(flag){
                cout << cx << " " << cy << " " << pred_h << endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: expected initializer before 'get'
   19 |             ll pred_h get<2>(G) + abs(get<0>(G) - cx) + abs(get<1>(G) - cy);
      |                       ^~~
a.cc:22:30: error: 'pred_h' was not declared in this scope
   22 |                 ll res = max(pred_h - abs(x[i] - cx) - abs(y[i] - cy), 0L);
      |                              ^~~~~~
a.cc:26:51: error: 'pred_h' was not declared in this scope
   26 |                 cout << cx << " " << cy << " " << pred_h << endl;
      |                                                   ^~~~~~
Language: Java

import java.util.*;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int flag = true;
		for (int k = 1; k < n; k++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			int h = sc.nextInt();
			if (h == 0) {
				continue;
			}
			if (flag) {
				py[i][j] = abs(x, i) + abs(y, j) + h;
				flag = false;
			} else {
				for (int i = 0; i <= 100; i++) {
					for (int j = 0; j <= 100; j++) {
						if (py[i][j] != abs(x, i) + abs(y, j) + h) {
							py[i][j] = 0;
						}
					}
				}
			}
		}
		
		int max = 0;
		int maxX = 0;
		int maxY = 0;
		for (int i = 0; i <= 100; i++) {
			for (int j = 0; j <= 100; j++){
				if (py[i][j] >= max) {
					max = py[i][j];
					maxX = i;
					maxY = j;
				}
			}
		}
		System.out.println(maxX + " " + maxY + " " + max);
	}
	
	public static int abs(int a, int b) {
		if (a > b) {
			return a - b;
		} else {
			return b - a;
		}
	}
}

Compiler output:
Main.java:8: error: incompatible types: boolean cannot be converted to int
		int flag = true;
		           ^
Main.java:16: error: incompatible types: int cannot be converted to boolean
			if (flag) {
			    ^
Main.java:17: error: cannot find symbol
				py[i][j] = abs(x, i) + abs(y, j) + h;
				^
  symbol:   variable py
  location: class Main
Main.java:17: error: cannot find symbol
				py[i][j] = abs(x, i) + abs(y, j) + h;
				   ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
				py[i][j] = abs(x, i) + abs(y, j) + h;
				      ^
  symbol:   variable j
  location: class Main
Main.java:17: error: cannot find symbol
				py[i][j] = abs(x, i) + abs(y, j) + h;
				                  ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
				py[i][j] = abs(x, i) + abs(y, j) + h;
				                              ^
  symbol:   variable j
  location: class Main
Main.java:18: error: incompatible types: boolean cannot be converted to int
				flag = false;
				       ^
Main.java:22: error: cannot find symbol
						if (py[i][j] != abs(x, i) + abs(y, j) + h) {
						    ^
  symbol:   variable py
  location: class Main
Main.java:23: error: cannot find symbol
							py[i][j] = 0;
							^
  symbol:   variable py
  location: class Main
Main.java:35: error: cannot find symbol
				if (py[i][j] >= max) {
				    ^
  symbol:   variable py
  location: class Main
Main.java:36: error: cannot find symbol
					max = py[i][j];
					      ^
  symbol:   variable py
  location: class Main
12 errors
Language: C++

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

using namespace std;

int main(void){
  int n;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  vector<long long int> h(n);
  int d=0
  for(int i=0;i<n;i++){
    cin >> x[i];
    cin >> y[i];
    cin >> h[i];
    if(h[i] >= 1) d=i;
  }

  //auto itr=lower_bound(h.begin(),h.end(),1);
  //auto d=distance(h.begin(),itr);
  //cout << x[d] << "," << y[d] << "," << h[d] << endl;
  int tx,ty;
  long long int h_max;

  auto match=0;

  for(int cx=0;cx<=100 && match==0;cx++){
    for(int cy=0;cy<=100 && match==0;cy++){
      h_max=h[d] + abs(cx-x[d]) + abs(cy-y[d]);
      h_max=max(h_max,0LL);
      //cout << cx << "," << cy << "," << h_max << endl;
      match=1;
      for(int i=0;i<h.size();i++){
        auto tmp=h_max - abs(cx-x[i]) - abs(cy-y[i]);
        if( h[i] != max(tmp , 0LL) ){
          match=0;
          break;
        }
      }
      if(match == 1){
        tx=cx;
        ty=cy;
      }

    }
  }

  cout << tx << " " << ty << " " << h_max << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'for'
   18 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:18:15: error: 'i' was not declared in this scope
   18 |   for(int i=0;i<n;i++){
      |               ^
Language: C++

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

int main()
{
    // input
    int N;
    std::vector<int> x, y, h;

    std::cin >> N;

    for (int i = 0; i < N; i++)
    {
        int x_input, y_input, h_input;
        std::cin >> x_input >> y_input >> h_input;

        x.push_back(x_input);
        y.push_back(y_input);
        h.push_back(h_input);
    }

    // answer
    // if (N == 1)
    // {
    //     std::cout << x[0] << " " << y[0] << " " << h[0] << std::endl;
    // }
    else if (N >= 1)
    {
        int H, CX, CY;
        int H_target, H_pre;
        int count = 0;

        for (int cx = 0; cx <= 100; cx++)
        {
            for (int cy = 0; cy <= 100; cy++)
            {
                // compute H for each n combinations
                // and if all H are same numbers, that is an answer
                for (int n = 0; n < N; n++)
                {
                    H_target = abs(x[n] - cx) + abs(y[n] - cy) + h[n];

                    if (n == 0)
                    {
                        H_pre = H_target;
                    }
                    else if (n > 0)
                    {
                        if (H_target == H_pre)
                        {
                            count++;
                            H_pre = H_target;
                        }
                        else
                        {
                            count = 0;
                            break;
                        }
                    }
                }

                if (count == N - 1)
                {
                    std::cout << cx << " " << cy << " " << H_target << std::endl;
                }
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'else' without a previous 'if'
   28 |     else if (N >= 1)
      |     ^~~~
Language: C++

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

int main()
{
    // input
    int N;
    std::vector<int> x, y, h;

    std::cin >> N;

    for (int i = 0; i < N; i++)
    {
        int x_input, y_input, h_input;
        std::cin >> x_input >> y_input >> h_input;

        x.push_back(x_input);
        y.push_back(y_input);
        h.push_back(h_input);
    }

    // answer
    if (N == 1)
    {
        std::cout << x[0] << " " << y[0] << " " << h[0] << std::endl;
    }
    else if (N >= 2)
    {
        int H, CX, CY;
        int H_target, H_pre;
        int count = 0;

        for (int cx = 0; cx <= 100; cx++)
        {
            for (int cy = 0; cy <= 100; cy++)
            {
                // compute H for each n combinations
                // and if all H are same numbers, that is an answer
                for (int n = 0; n < N; n++)
                {
                    H_target = abs(x[n] - cx) + abs(y[n] - cy) + h[n];

                    if (n == 0)
                    {
                        H_pre = H_target;
                    }
                    else if (n > 0)
                    {
                        if (H_target == H_pre)
                        {
                            count++;
                            H_pre = H_targer;
                        }
                        else
                        {
                            count = 0;
                            break;
                        }
                    }
                }

                if (count == N - 1)
                {
                    std::cout << cx << " " << cy << " " << H_target << std::endl;
                }
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:37: error: 'H_targer' was not declared in this scope; did you mean 'H_target'?
   53 |                             H_pre = H_targer;
      |                                     ^~~~~~~~
      |                                     H_target
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int height(int cx, int cy, vector<vector<int>> &points){
  int j;
  for (j=0; j < points.size(); j++){
    if (points[i][2] != 0) break;
  }
  int hgt = max(abs(points[j][0] - cx) + abs(points[j][1] - cy) + points[j][2], 0);
  int htmp;
  int ret = hgt;
  for (int i=1; i < points.size(); i++){
    htmp = max(hgt - abs(points[i][0] - cx) - abs(points[i][1] - cy), 0);
    if (hgt != htmp){
		ret = -1;
      	break;
    }
  }
  
  return ret;
}
      

int main(){
  int N, x, y, h, ans;
  cin >> N;
  vector<vector<int>> points;
  for (int i=0; i<N; i++){
    cin >> x >> y >> h;
    points.push_back(vector<int>({x, y, h}));
  }
  for (int cx = 0; cx <= 100; cx++){
    for (int cy = 0; cy <= 100; cy++){
      ans = height(cx, cy, points);
      if (ans != -1) break;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

      


Compiler output:
a.cc: In function 'int height(int, int, std::vector<std::vector<int> >&)':
a.cc:10:16: error: 'i' was not declared in this scope
   10 |     if (points[i][2] != 0) break;
      |                ^
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>
#define ABS(a) (a>0?(a):(-a))

int main()
{
    int n, i, j;
    int x[100], y[100], h[100];
    int max=0;
    int cx, cy, ch;

    scanf("%d",&n);d

    for(i=0; i<n; i++) {
        scanf("%d %d %d",&x[i],&y[i],&h[i]);
        if(max<h[i]) {
            max = h[i];
        }
    }

    for(cx=0; cx<=100; cx++) {
        for(cy=0; cy<=100; cy++) {
            for(ch=max; ch<max+100; ch++) {
                int count=0;
                for(i=0; i<n; i++) {
                    if(ch == h[i] + ABS(cx-x[i]) + ABS(cy-y[i])) {
                        count++;
                    }
                }
                if(count==n){
                    printf("%d %d %d",cx, cy, ch);
                    return 0;
                }
            }
        }
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:20: error: 'd' undeclared (first use in this function)
   13 |     scanf("%d",&n);d
      |                    ^
main.c:13:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:21: error: expected ';' before 'for'
   13 |     scanf("%d",&n);d
      |                     ^
      |                     ;
   14 | 
   15 |     for(i=0; i<n; i++) {
      |     ~~~
Language: C++

import java.util.*;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[]$) {
        Scanner sc = new Scanner(in);
        ArrayList<Point> ans=new ArrayList<>();
        HashMap<Point,Integer> mapH=new HashMap<>();
        HashMap<Point,Integer> mapcx=new HashMap<>();
        HashMap<Point,Integer> mapcy=new HashMap<>();
        int n=sc.nextInt();
        int[] x=new int[n];
        int[] y=new int[n];
        int[] h=new int[n];
        for (int i = 0; i < n; i++) {
            x[i]=sc.nextInt();
            y[i]=sc.nextInt();
            h[i]=sc.nextInt();
        }
        for(int i=0;i<n;i++) {
            for (int j = 0; j < 101; j++) {
                for (int k = 0; k < 101; k++) {
                    int H=h[i]+abs(x[i]-j)+abs(y[i]-k);
                    int judge=0;
                    for (int l = 0; l < n; l++) {
                        if(H==h[l]+abs(x[l]-j)+abs(y[l]-k))judge++;
                        if(judge==n){
                            out.println(j+" "+k+" "+H);
                            exit(0);
                        }
                    }
                }
            }
        }
    }
    static long power(long x,int n){
        long mod=1000000007;
        long ans=1;
        while (n>0) {
            if((n&1)==1){
                ans=(ans*x)%mod;
            }
            x=(x*x)%mod;
            n>>=1;
        }
        return ans;
    }
    //最大公約数
    static int gcd (int a,int b) {
        int temp;
        while((temp = a%b)!=0) {
            a = b;
            b = temp;
        }
        return b;
    }
    //※最小公倍数はa*b/gcd(a,b)である
    static class UF{
        static int size=51;
        static int[] par=new int[size];
        //初期化
        static void init(){
            for (int i = 1; i <size ; i++) {
                par[i]=i;
            }
        }
        //根をたどる
        static int root(int x){
            if(par[x]==x){
                return x;
            }else{
                return par[x]=root(par[x]);
            }
        }
        //同じ根をもつか(同じ集合に属するか)判定
        static boolean same(int x,int y){
            return root(x)==root(y);
        }
        //合体
        static void unite(int x,int y){
            x=root(x);
            y=root(y);
            if(x==y)return;
            par[x]=y;
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.awt.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import static java.lang.System.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C

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

int main(void){
  int n,x[n],y[n],h[n],i,j,k,l,count=0;
  scanf("%d", &n);
  	
  for(i=0;i<n;i++){
	scanf("%d%d%d", &x[i],&y[i],&h[i]);
  }
  
  int max=h[0];
  for(i=1;i<n;i++){
	if(h[i]>max){
		max=h[i];
    }
  }

  	
  for(i=0;i<100;i++){                                      //x
    for(j=0;j<100;j++){                                    //y
      for(k=max;k<100;k++){                                //H
		if(k==h[0]+abs(x[0]-i)+abs(y[0]-j)){
			for(l=1;l<n;l++){
				if(k==h[l]+abs(x[l]-i)+abs(y[l]-j)){
						count++;
                  	if(count==n-1){
						int X=i;
                      	int Y=j;
                      	int H=k;
                      	break;
                    }
                }else{
                  break;
                }
            }
        }
      }
    }
  }
  
  
        printf("%d%d%d", X,Y,H);
}
        
        
        
        
        
        
		

Compiler output:
main.c: In function 'main':
main.c:43:26: error: 'X' undeclared (first use in this function)
   43 |         printf("%d%d%d", X,Y,H);
      |                          ^
main.c:43:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:43:28: error: 'Y' undeclared (first use in this function)
   43 |         printf("%d%d%d", X,Y,H);
      |                            ^
main.c:43:30: error: 'H' undeclared (first use in this function)
   43 |         printf("%d%d%d", X,Y,H);
      |                              ^
Language: C++

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

int height(int xs[], int ys[], int hs[], int cx, int cy, int n) {
    int i = 0;
    for (; hs[i] == 0; i++) {}
    int ch = hs[i] + abs(xs[i] - cx) + abs(ys[i] - cy);
    for (i++; i < n; i++) {
        if (hs[i] != max(ch - abs(xs[i] - cx) - abs(ys[i] - cy), 0)
            return 0;
    }
    return ch;
}

int main() {
    int n;
    cin >> n;
    int xs[n], ys[n], hs[n];
    for (int i = 0; i < n; i++) {
        cin >> xs[i] >> ys[i] >> hs[i];
    }
    for (int cy = 0; cy <= 100; cy++) {
        for (int cx = 0; cx <= 100; cx++) {
            int ch = height(xs, ys, hs, cx, cy, n);
            if (ch > 0) {
                cout << cx << ' ' << cy << ' ' << ch << endl;
                return 0;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int height(int*, int*, int*, int, int, int)':
a.cc:10:68: error: expected ';' before 'return'
   10 |         if (hs[i] != max(ch - abs(xs[i] - cx) - abs(ys[i] - cy), 0)
      |                                                                    ^
      |                                                                    ;
   11 |             return 0;
      |             ~~~~~~                                                  
a.cc:12:5: error: expected primary-expression before '}' token
   12 |     }
      |     ^
a.cc:11:22: error: expected ')' before '}' token
   11 |             return 0;
      |                      ^
      |                      )
   12 |     }
      |     ~                 
a.cc:10:12: note: to match this '('
   10 |         if (hs[i] != max(ch - abs(xs[i] - cx) - abs(ys[i] - cy), 0)
      |            ^
a.cc:12:5: error: expected primary-expression before '}' token
   12 |     }
      |     ^
Language: C

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

int main(void){
	int n,i,j,x[n],y[n],h[n],H;
  	
  	scanf("%d", &n);
  	
  	for(i=0;i<n;i++){
      	scanf("%d%d%d", &x[i],&y[i],&h[i]);
    }
  	
  	int　max = h[0];
  	for(i=1;i<n;i++){
		if(h[i]>max){
			max = h[i];
        }
    }
  int a,b,c;
  	for(i=1;i<=100;i++){
      	for(j=1;j<=100;j++){
          	for(int k=max;k<101-max;k++){
          	if(k==h[0]+abs(x[0]-i)+abs(y[0]-j)){
				for(int l=1;l<n;l++){
					if(k==h[l]+abs(x[l]-i)+abs(y[l]-j)){
						a=i;
                      	b=j;
                      	c=k;
                    }
                }
            }
            }
        }
    }
  
                       
    printf("%d %d %d", a,b,c);
}


Compiler output:
main.c: In function 'main':
main.c:13:12: error: stray '\343' in program
   13 |         int<U+3000>max = h[0];
      |            ^~~~~~~~
Language: C

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

int main(void){
	int n,i,j,x[n],y[n],h[n],H,max=0;
  	
  	scanf("%d", &n);
  	
  	for(i=0;i<n;i++){
      	scanf("%d%d%d", &x[i],&y[i],&h[i]);
    }
  	
  	int　max = h[0];
  	for(i=1;i<n;i++){
		if(h[i]>max){
			max = h[i];
        }
    }
  int a,b,c;
  	for(i=1;i<=100;i++){
      	for(j=1;j<=100;j++){
          	for(int k=max;k<101-max;k++){
          	if(k==h[0]+abs(x[0]-i)+abs(y[0]-j)){
				for(int l=1;l<n;l++){
					if(k==h[l]+abs(x[l]-i)+abs(y[l]-j)){
						a=i;
                      	b=j;
                      	c=k;
                    }
                }
            }
            }
        }
    }
  
                       
    printf("%d %d %d", a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:13:12: error: stray '\343' in program
   13 |         int<U+3000>max = h[0];
      |            ^~~~~~~~
main.c:13:14: error: redefinition of 'max'
   13 |         int　max = h[0];
      |              ^~~
main.c:5:36: note: previous definition of 'max' with type 'int'
    5 |         int n,i,j,x[n],y[n],h[n],H,max=0;
      |                                    ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>

using namespace std;

using lli = long long;

#ifdef DEBUG
#define debug(var) cout << (#var) << ": " << (var) << endl;
template<class T> void dump_array_impl(const T& a) {
  bool first = true;
  for (auto&& x : a) {
    if (!first) { cout << ", "; first = false; }
    cout << x;
  }
}
#define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
#else
#define debug(var) ()
#define debug_array(a) ()
#endif

struct P {
  int x, y, h;
};
lli n;
vector<P> ps;
int main() {
  cin >> n;
  ps = decltype(ps)(n);
  for (int i=0; i<n; ++i) {
    cin >> ps[i].x >> ps[i].y >> ps[i].h;
  }
  
  P ans;
  ans.h = -1;
  for (int y=0; y<=100; ++y) {
    for (int x=0; x<=100; ++x) {
      auto&& p = ps[0];
      int h = p.h + abs(x-p.x) + abs(y-p.y);
      bool ok = true;
      for (auto&& p : ps) {
	int hh = p.h + abs(x-p.x) + abs(y-p.y);
	if (h != hh) {
	  ok = false;
	  break;
	}
      }
      assert(!(ok && h == ans.h));
      if (ok && h > ans.h) {
	ans = {x, y, h};
      }
    }
  }

  printf("%d %d %d\n", ans.x, ans.y, ans.h);
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:7: error: 'assert' was not declared in this scope
   53 |       assert(!(ok && h == ans.h));
      |       ^~~~~~
a.cc:7:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    6 | #include <numeric>
  +++ |+#include <cassert>
    7 |
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
    ll n; ll x[105][3];
    cin >> n;
    for(int a = 0; a < n; a++){
        cin >> x[a][0] >> x[a][1] >> x[a][2];
    }
    for(int b = 0; b <= 100; b++){
        for(int c = 0; c <= 100; c++){
            int i = 0;
            ll h;
            while(true){
                h = x[i][2]+abs(x[i][1]-c)+abs(x[i][0]-b);
                if(x[i][2] != 0)break;          
                i++;
            }
            for(int d = 0; d < n; d++){
                if(x[d][2] != max(0,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:23:34: error: no matching function for call to 'max(int, ll)'
   23 |                 if(x[d][2] != max(0,h-abs(x[d][1]-c)-abs(x[d][0]-b)))break;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:34: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   23 |                 if(x[d][2] != max(0,h-abs(x[d][1]-c)-abs(x[d][0]-b)))break;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |                 if(x[d][2] != max(0,h-abs(x[d][1]-c)-abs(x[d][0]-b)))break;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	int n;
	ll ansh=-1,cx=-1,cy=-1;
	vector<ll> x,y,hs;
	cin >> n;
	for(int i=0;i<n;i++){
		int t1,t2,t3;
		cin >> t1 >> t2 >> t3;
		x.push_back(t1);
		y.push_back(t2);
		hs.push_back(t3);
	}
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			bool ansflg = true;
			vector<ll> h;
			for(int k=0;k<n;k++){
				
					h.push_back(hs[k]+abs(x[k]-i)+abs(y[k]-j));
			}
			
			for(int k=0;k<n;k++){
				if(hs[k]!=max(h[k]-abs(x[k]-i)-abs(y[k]-j)))
					ansflg = false;
			}
			if(ansflg&&h[0]>=1){
				ansh = h[0];
				cx = i;
				cy = j;
			}	
		}
	}
	cout<<cx<<" "<<cy<<" "<<ansh<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:46: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   26 |                                 if(hs[k]!=max(h[k]-abs(x[k]-i)-abs(y[k]-j)))
      |                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:26:46: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |                                 if(hs[k]!=max(h[k]-abs(x[k]-i)-abs(y[k]-j)))
      |                                           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++


#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<stdio.h>
#include<set>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    int x[n],y[n],h[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i]>>h[i];
    }
 
    int ansx=0,ansy=0;
    int en;
    int HH;
    for(int u=0;u<n;u++){
        if(h[u]!=0){
            HH=h[u]+abs(x[u]-i)+abs(y[u]-j);
            en=u;
            break;
        }
    }    for(int i=0;i<=100;i++){
        for(int j=0;j<=100;j++){
            
            
            for(int u=0;u<n;u++){
                if(h[u]==0){
                    break;
                }else{
                    int H=h[u]+abs(x[u]-i)+abs(y[u]-j);
                    if(HH!=H){
                        break;
                    }else{
                        if(u==n-1){
                            ansx=i;ansy=j;
                            break;
                        }
                    }
                }
            }
        }
        
    }
    int ansh=h[en]+abs(x[en]-ansx)+abs(y[en]-ansy);
    cout<<ansx<<" "<<ansy<<" "<<ansh<<endl;
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'i' was not declared in this scope
   24 |             HH=h[u]+abs(x[u]-i)+abs(y[u]-j);
      |                              ^
a.cc:24:42: error: 'j' was not declared in this scope
   24 |             HH=h[u]+abs(x[u]-i)+abs(y[u]-j);
      |                                          ^
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#define ppp pair<pair<int, int>, int>
using namespace std;

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

    vector<ppp> A(N);
    bool flag = false;
    for (int i = 0; i < N; ++i)
    {
        cin >> A[i].first.first >> A[i].first.second >> A[i].second;
        if (A[i].second != 0)
            flag = true;
    }

    if (flag)
    {
        for (int i = 0; i <= 100; ++i)
        {
            for (int j = 0; j <= 100; ++j)
            {
                int k = 0;
                int H = 0;
                while (k < N)
                {
                    if (A[k].second != 0)
                    {
                        H = abs(i - A[k].first.first) + abs(j - A[k].first.second) + A[k].second;
                        break;
                    }
                }
                for (k = 0; k < N; ++k)
                {
                    int h = max(H - abs(i - A[k].first.first) - abs(j - A[k].first.second), 0);
                    if (h != A[k].second)
                        break;
                }
                if (k != N)
                    continue;
                else
                {
                    cout << i << " " << j << " " << H << endl;
                    return 0;
                }
            }
        }
    }
    else
    {
        for (int i = 0; i <= 100; ++i)
        {
            for (int j = 0; j <= 100; ++j)
            {
                for (int H = 0; H <= 100; ++H)
                {
                    for (k = 0; k < N; ++k)
                    {
                        int h = max(H - abs(i - A[k].first.first) - abs(j - A[k].first.second), 0);
                        if (h != A[k].second)
                            break;
                    }
                    if (k != N)
                        continue;
                    else
                    {
                        cout << i << " " << j << " " << H << endl;
                        return 0;
                    }
                }
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:26: error: 'k' was not declared in this scope
   62 |                     for (k = 0; k < N; ++k)
      |                          ^
a.cc:68:25: error: 'k' was not declared in this scope
   68 |                     if (k != N)
      |                         ^
Language: C++

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

int main(int argc, char **argv)
{
	cin.tie(NULL);

	int N;
	cin >> N;

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

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

	for (i = 0; i <= 100; i++)
	{
		for (int j = 0; j <= 100; j++)
		{
			long long ch = 0;
			long long limit = LONG_MAX;
			int k = 0;
			for (k = 0; k < N; k++)
			{
				if (h[k] == 0)
				{
					int tmp_limit = abs(x[k]-i) + abs(y[k] - j);
					if (ch > tmp_limit)
					{
						break;
					}
					if (tmp_limit < limit)
					{
						limit = tmp_limit;
					}
				}
				else 
				{
					if (ch == 0)
					{
						ch = abs(x[k] - i) + abs(y[k] - j) + h[k];

					}
					else if (ch != (abs(x[k] - i) + abs(y[k] - j) + h[k]))
					{
						break;
					}

					if ((ch > limit) || (ch < 1) )
					{
						break;
					}
				}
				
			}
			if (k >= N)
			{
				cout << i << " " << j << " " << ch << endl;
				return 0;
			}
			//cout << i << " " << j << " " << ch << endl;
		}

	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:25:43: error: 'LONG_MAX' was not declared in this scope
   25 |                         long long limit = LONG_MAX;
      |                                           ^~~~~~~~
a.cc:3:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cmath>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

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

int main(void){
	int n;
	cin >> n;
	vector<long long> x(n),y(n),h(n);
	for(int i=0; i<n; i++)cin >> x[i] >> y[i] >> h[i];
	for(long long i=0; i<=100; i++){
		for(long long j=0; j<=100; j++){
			long long temph=0,temp=0;
			while(temph==0){
				temph=h[temp]+abs(x[temp]-i)+abs(y[temp]-j);
				temp++;
			}
			int flag=1;
			for(int k=0; k<n; k++){
				if(max(0,temph-abs(x[k]-i)-abs(y[k]-j))!=h[k]){
					flag=0;
					break;
				}
			}
			if(flag){
				cout << i << " " << j << " " << temph << endl;
				return 0;
			}
		}
	}
	cout << "tapi" << endl;
	return 0;
}	

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

#include <bits/stdc++.h>

#define debug 0

using namespace std;
typedef long long lint;

const int maxn = 1e2+5;

struct pr
{
    lint x, y;
};

lint n, i, j, h;
pr v[maxn]; lint b[maxn];

inline lint ab(lint x) { return (x < 0 ? -x: x); }
inline lint dist(pr x, pr y) { // manhattan
    return ( ab(x.x - y.x) + ab(x.y - y.y) );
}

int main()
{
    #if debug
    freopen("f.in", "r", stdin);
    freopen("f.out", "w", stdout);
    #endif

    cin >> n;
    for(i = 1; i <= n; i ++) {
        cin >> v[i].x >> v[i].y >> b[i];
    }

    for(i = 0; i <= 100; i ++) {
        for(j = 0; j <= 100; j ++) {

            bool ok = true;
            llint height = b[1] + dist({i, j}, v[1]);
            for(h = 2; h <= n && ok == true; h ++) {
                if( ((1LL * dist({i, j}, v[h])) + b[h]) != height) {
                    ok = false;
                }
            }
            if(ok == true) {
                cout << i << ' ' << j << ' ' << height << '\n';
                return 0;
            }

        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'llint' was not declared in this scope; did you mean 'lrint'?
   39 |             llint height = b[1] + dist({i, j}, v[1]);
      |             ^~~~~
      |             lrint
a.cc:39:46: error: expected primary-expression before ',' token
   39 |             llint height = b[1] + dist({i, j}, v[1]);
      |                                              ^
a.cc:41:60: error: 'height' was not declared in this scope
   41 |                 if( ((1LL * dist({i, j}, v[h])) + b[h]) != height) {
      |                                                            ^~~~~~
a.cc:46:49: error: 'height' was not declared in this scope
   46 |                 cout << i << ' ' << j << ' ' << height << '\n';
      |                                                 ^~~~~~
Language: C++

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

int X[110], Y[110], H[110], n;
int main()
{
	scanf("%d", &n);
	for(int i=0;i<n;i++)
		scanf("%d %d %lld", &X[i], &Y[i], &H[i]);

	int hh;
	for(int x=0;x<=100;x++)
		for(int y=0;y<=100;y++)
		{
			int i; hh = -1;
			for(i=0;i<n;i++)
				if(H[i]>0)
				{
					if(hh==-1)
						hh = H[i] + abs(x-X[i]) + abs(y-Y[i]);
					else if(hh != H[i] + abs(x-X[i]) + abs(y-Y[i]))
						break;
				}
			if(hh!=-1 i>=n) return 0*printf("%d %d %lld\n", x, y, hh);
		}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: expected ')' before 'i'
   26 |                         if(hh!=-1 i>=n) return 0*printf("%d %d %lld\n", x, y, hh);
      |                           ~      ^~
      |                                  )
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
 
int main()
{
	int N = 0;
	long long x[1010] = {}, y[1010] = {}, h[1010] = {};
	long long  info[3] = {};
	long long pseudo=0 ,ansx=0 ,ansy=0,  ansh=0;
 
	cin >> N;
 
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i] >> h[i];
 
		if (h[i] > 0) {
			info[0] = x[i];
			info[1] = y[i];
			info[2] = h[i];
		}
	}
 
	long long check = 0;
	bool flag = 1;
 
	for (int dx = 0; dx < 101; dx++) {
		for (int dy = 0; dy < 101; dy++) {
			pseudo = info[2] + abs(info[0] - dx) + abs(info[1] - dy);
			pseudo = max(0LL, pseudo);
			flag = 1;
			for (int k = 0; k < N; k++) {
				check = h[k] + abs(x[k] - dx) + abs(y[k] - dy);
				check = max(check, 0LL);
				if (check != pseudo) flag = 0;
			}
			if (flag) {
				ansx = dx, ansy = dy, ansh = pseudo;
			}
			
		}
	}
 
	cout << ansx <<" " <<ansy << " " <<ansh <<endl;
 
	return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;


int main()
{
	int N = 0;
	long long x[1010] = {}, y[1010] = {}, h[1010] = {};
	long long  info[3] = {};
	long long pseudo=0 ,ansx=0 ,ansy=0,  ansh=0;

	cin >> N;

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

		if (h[i] > 0) {
			info[0] = x[i];
			info[1] = y[i];
			info[2] = h[i];
		}
	}

	long long check = 0;
	bool flag = 1;

	for (int dx = 0; dx < 101; dx++) {
		for (int dy = 0; dy < 101; dy++) {
			pseudo = info[2] + abs(info[0] - dx) + abs(info[1] - dy);
			pseudo = max(0LL, pseudo);
			flag = 1;
			for (int k = 0; k < N; k++) {
				check = h[k] + abs(x[k] - dx) + abs(y[k] - dy);
				check = max(check, 0LL);
				if (check != pseudo) flag = 0;
			}
			if (flag) {
				ansx = dx, ansy = dy, ansh = pseudo;
			}
			
		}
	}

	cout << ansx <<" " <<ansy << " " <<ansh <<endl;

	return 0;
}
Submission

Compiler output:
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main()
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main()
      |     ^~~~
a.cc:97:1: error: 'Submission' does not name a type
   97 | Submission
      | ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int x[101],y[101],h[101];
	cin>>n;
	int bx,by,bh;
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i]>>h[i];	
		if(h[i]>0){
			bx=x[i];
			by=y[i];
			bh=h[i];
		}
	}
	int he;
	bool flg;
	for(int i=0;i<101;i++){
		for(int j=0;j<101;j++){
			int H=abs(i-by)+abs(j-bx)+bh;
			H=max(H,0);
			flg=false;
			for(int k=0;k<n;k++){
				he=H-abs(i-y[k])-abs(j-x[k]);
				he=max(he,0);
				if(he!=h[k])	flg=true;
			if(!flg){
				cout<<j<<" "<<i<<" "<<height[0];
				return 0;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:55: error: 'height' was not declared in this scope
   28 |                                 cout<<j<<" "<<i<<" "<<height[0];
      |                                                       ^~~~~~
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^