criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.*;

public class ABC112 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        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();
        }

        int cx = 0;
        int cy = 0;
        int ch = 1;
        label:
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                boolean isAns = true;
                cx = i;
                cy = j;
                ch = Math.abs(x[0] - cx) + Math.abs(y[0] - cy) + h[0];

                for (int k = 1; k < n; k++) {
                    int tmp = Math.abs(x[k] - cx) + Math.abs(y[k] - cy) + h[k];
                    if ((ch != tmp && h[k] > 0) || (ch > tmp && h[k] == 0)) {
                        isAns = false;
                        break;
                    }
                }

                if (isAns)
                    break label;
            }
        }

        System.out.println(cx + " " + cy + " " + ch);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Compiler output:
Main.java:4: error: class ABC112 is public, should be declared in a file named ABC112.java
public class ABC112 {
       ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class ABC112 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        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();
        }

        int cx = 0;
        int cy = 0;
        int ch = 1;
        label:
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                boolean isAns = true;
                cx = i;
                cy = j;
                ch = Math.abs(x[0] - cx) + Math.abs(y[0] - cy) + h[0];

                for (int k = 1; k < n; k++) {
                    int tmp = Math.abs(x[k] - cx) + Math.abs(y[k] - cy) + h[k];
                    if (ch != tmp) {
                        isAns = false;
                        break;
                    }
                }

                if (isAns)
                    break label;
            }
        }

        System.out.println(cx + " " + cy + " " + ch);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

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

#include <iostream>
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];
  }
  
  if(N==1) {
    cout << X[0] << " " << Y[0] << " " << H[0] << endl;
  }
  
  int t = 0;
  for(int i=0; i<N; i++) {
    if(H[i]!=0) {
      t = i;
    }
  }
  
  bool flag = false;
  for(int x=0; x<=100; x++) {
    for(int y=0; y<=100; y++) {
      int tmp = abs(X[t]-x) + abs(Y[t] - y) + H[t];
      for(int i=0; i<N; i++) {
        int h = abs(X[i]-x) + abs(Y[i] - y) + H[i];
        if(H[i] != 0) {
          if(tmp==h) {
            flag = true;
          } else {
            flag = false;
            break;
          }
        } else {
          if(tmp=>h) {
            flag = true;
          } else {
            flag = false;
            break;
          }
        }
      }
      if(flag==true) {
        cout << x << " " << y << " " << tmp << endl;
        return 0;
      }
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:18: error: expected primary-expression before '>' token
   39 |           if(tmp=>h) {
      |                  ^
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

typedef tuple<long,long,long> TP;

int main() {
  int n;
  cin >> n;
  TP ans = TP(0,0,0);
  vector<TP> re;
  for (int i=0; i<n; i++) {
    long x,y,h;
    cin >> x >> y >> h;
    re.push_back(TP(x,y,h));
  }

  for (int cx=0; cx<=100; cx++) {
    for (int cy=0; cy<=100; cy++) {
      long h = -1;
      bool f = true;
      for (auto r : re) {
        long x,y,hi;
        tie(x,y,hi) = r;
        if (h1 <= 0) continue;  // max(H-|x-Cx|-|y-Cy|, 0) でマイナスな値になっている場合計算がおかしくなる？
        if (h < 0) {
          h = abs(x-cx) + abs(y-cy) + hi;
          continue;
        }

        if (h != abs(x-cx) + abs(y-cy) + hi) {
          f = false;
          break;
        }
      }
      if (f && h>0) ans = TP(cx,cy,h);
    }
  }
  long x,y,h;
  tie(x,y,h) = ans;

  cout << x << " " << y << " " << h << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'h1' was not declared in this scope; did you mean 'hi'?
   31 |         if (h1 <= 0) continue;  // max(H-|x-Cx|-|y-Cy|, 0) でマイナスな値になっている場合計算がおかしくなる？
      |             ^~
      |             hi
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1e9+1;

/*
hi = h - |xi - cx| - |yi - cy|
の式N個から、h, cx, cyを計算する

cx、cyを全探索し、hがすべて同じになるような場合を答えとする
計算量は1000000程度なのでいけそう
*/

void solve(){
    int n;
    cin >> n;
    vector<int> x;
    vector<int> y;
    vector<int> h;
    rep(i,n){
        int a,b,c;
        cin >> a >> b >> c;
        if(c>=1){
            x.emplace_back(a);
            y.emplace_back(b);
            h.emplace_back(c);
        }
    }
    int s = x.size();
    bool ans = true;
    int a1,a2,a3;
    rep(cx,101){
        rep(cy,101){
            ans = true;
            //int cons = -1;
            int cons = h[0] + abs(x[0]-cx) + abs(y[0]-cy);
            for(int i=1; i<s; i++){
                if(h[i] != max(cons - abs(x[i]-cx) - abs(y[i]-cy),(ll)0)){
                    ans = false;
                }
            }
            if(ans) {
                a1 = cx;
                a2 = cy;
                a3 = cons;
            }
        }
    }
    cout << cx << " " << cy << " " << cons << endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:52:13: error: 'cx' was not declared in this scope; did you mean 'x'?
   52 |     cout << cx << " " << cy << " " << cons << endl;
      |             ^~
      |             x
a.cc:52:26: error: 'cy' was not declared in this scope; did you mean 'y'?
   52 |     cout << cx << " " << cy << " " << cons << endl;
      |                          ^~
      |                          y
a.cc:52:39: error: 'cons' was not declared in this scope; did you mean 'cos'?
   52 |     cout << cx << " " << cy << " " << cons << endl;
      |                                       ^~~~
      |                                       cos
Language: C++

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1111111111;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T>
inline bool chmin(T &a, T b) { return a > b && (a = b, true); }

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	struct data { lint x, y, h; };
	vector<data> d(N);
	for (int i = 0; i < N; i++) cin >> d[i].x >> d[i].y >> d[i].h;

	for (int x = 0; x <= 100; x++) {
		for (int y = 0; y <= 100; y++) {
			
			lint ref = d[0].h + abs(d[0].x - x) + abs(d[0].y - y));

			if (all_of(d.begin(), d.end(), 
				[&](data d) { return max(ref - abs(d.x - x) - abs(d.y - y), 0LL) == d.h; })) {

				cout << x << " " << y << " " << ref << "\n";
				return 0;
			}

		}
	}

	return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:78: error: expected ',' or ';' before ')' token
   55 |                         lint ref = d[0].h + abs(d[0].x - x) + abs(d[0].y - y));
      |                                                                              ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] x = new int[N];
        int[] y = new int[N];
        int[] h = new int[N];
        for (int i = 0; i < N; i++) {
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            h[i] = sc.nextInt();
        }

        for (int cx = 0; cx <= 100; cx++) {
            for (int cy = 0; cy <= 100; cy++) {
                int[] heights = new int[N];
                boolean allSame = true;
                for (int i = 0; i < N; i++) {
                    if (h[i] >= 1) {
                        heights[i] = h[i] + Math.abs(x[i] - cx) + Math.abs(y[i] - cy);
                        // ★ここの判定条件が違っていると思う。。
                        if (i >= 1) {
                            if (heights[i] != heights[i - 1]) {
                                allSame = false;
                                break;
                            }
                        }
                    }
                }
                if (allSame == true) {
                    System.out.print(cx + " " + cy + " " + heights[0]);
                    return;
                }
            }
        }
    }

    // Main
    public static void main(String[] args) {
        new Main.solve();
    }
}



Compiler output:
Main.java:44: error: cannot find symbol
        new Main.solve();
                ^
  symbol:   class solve
  location: class Main
1 error
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

stract pt{
    int x,y,h;
}

int height(int x, int y, int cx, int cy, int ch){
    return max(0,ch-intfabs(x-cx)-intfabs(y-cy));
}

main(){
    int n=in(),h,i,fx,fy;
    bool tf;
    pt xyh[n];
    for (i=0;i<n;i++) cin >> xyh.x[i] >> xyh.y[i] >> xyh.h[i];
    for (int x=0;x<101;x++){
        for (int y=0;y<101;y++){
            tf=true;
            h=-1;
            for (i=0;h<=0;i++) h=xyh.h[i];
            h=h+intfabs(x-xyh.x[i])+intfabs(y-xyh.y[i]);
            for (i=0;i<n;i++){
                if (xyh.h[i]!=h-intfabs(x-xyh.x[i])-intfabs(y-xyh.y[i])) tf=false;
            }
            if (tf) {
                cout << x << ' ' << y << ' ' << h << endl;
                return 0;
            }
        }
    }
}


Compiler output:
a.cc:50:1: error: 'stract' does not name a type; did you mean 'struct'?
   50 | stract pt{
      | ^~~~~~
      | struct
a.cc:58:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   58 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:61:5: error: 'pt' was not declared in this scope
   61 |     pt xyh[n];
      |     ^~
a.cc:62:30: error: 'xyh' was not declared in this scope
   62 |     for (i=0;i<n;i++) cin >> xyh.x[i] >> xyh.y[i] >> xyh.h[i];
      |                              ^~~
a.cc:67:34: error: 'xyh' was not declared in this scope
   67 |             for (i=0;h<=0;i++) h=xyh.h[i];
      |                                  ^~~
a.cc:68:27: error: 'xyh' was not declared in this scope
   68 |             h=h+intfabs(x-xyh.x[i])+intfabs(y-xyh.y[i]);
      |                           ^~~
Language: C++

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

int main() {

  int N;
  cin >> N;
  vector<long long> x(N), y(N); 
  vector<long long> h(N);
  long long cx, cy;
  long long height;
  int Flag = 1;


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

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

      for ( int i = 0; i < N; i++ ){
        if ( h.at(i) != 0 ){
            height = h.at(i) + abs( x.at(i) - cx ) + abs( y.at(i) - cy );
            break;
        }
      }

      Flag = 1;
      for ( int i = 1; i < N; i++ ){
        long long s = height - abs( x.at(i) - cx ) - abs( y.at(i) - cy );
        if ( h.at(i) != max( s, 0 ) ){
          Flag = 0; break;
        }
        else
          Flag = 1;
      }

      if ( Flag == 1 ){
        printf("%d %d %d\n", cx, cy, height);
        return 0;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:28: error: no matching function for call to 'max(long long int&, int)'
   32 |         if ( h.at(i) != max( s, 0 ) ){
      |                         ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   32 |         if ( h.at(i) != max( s, 0 ) ){
      |                         ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |         if ( h.at(i) != max( s, 0 ) ){
      |                         ~~~^~~~~~~~
Language: Java

public class Main {
  public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);
 
    int n = sc.nextInt();
    int[][] table = new int[n][4];
    for(int i = 0; i < n; i++){
      table[i][0] = sc.nextInt();
      table[i][1] = sc.nextInt();
      table[i][2] = sc.nextInt();
    }
 
    for(int x = 0; x <= 100; x++){
      for(int y = 0; y <= 100; y++){
        for(int h = Math.max(table[0][2] - 250, 1); h < table[0][2] + 250; h++){
          boolean check = true;
          for(int i = 0; i < n; i++){
            if(table[i][2] != Math.max(h - Math.abs(x - table[i][0]) - Math.abs(y - table[i][1]), 0)){
              check = false;
            }
          }
          if(check){
            System.out.print(x);
            System.out.print(" ");
            System.out.print(y);
            System.out.print(" ");
            System.out.print(h);
          }
        }
 
 
      }
    }
 
  }

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

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

int main(void) {
    int n;
    scanf("%d", &n);

    int p[n][3];
    for (int i = 0; i < n; i++) {
        int x, y, h;
        scanf("%d %d %d", &x, &y, &h);
        p[i][0] = x;
        p[i][1] = y;
        p[i][2] = h;
    }

    for (int i = 0; i <= 100; i++) {
        for (int j = 0; j <= 100; j++) {
            int ans_h = -1;
            for (int l = 0; l < n; l++) {
                int x = p[l][0], y = p[l][1], h = p[l][2];

                if (ans_h == -1) {
                    int tmp;
                    tmp = abs(x - i) + abs(y - j) + h;
                    if (tmp < 0 && h !+ 0) {
                        break;
                    }
                    ans_h = tmp;
                    continue;
                }

                int tmp = abs(x - i) + abs(y - j) + h;

                if (tmp != ans_h && h != 0) {
                    break;
                }

                if (l == n - 1) {
                    printf("%d %d %d\n", i, j, ans_h);
                    return 0;
                }
            }
        }
    }

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:37: error: expected ')' before '!' token
   26 |                     if (tmp < 0 && h !+ 0) {
      |                        ~            ^~
      |                                     )
Language: C++

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

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:49: error: 'v' was not declared in this scope
   21 |                 cout << i << " " << j << " " << v;
      |                                                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int R[110], C[110], H[110];
int r, c, h;

int g(int p) {
  return H[p] + abs(r-R[p]) + abs(c-C[p]);
}

bool f(int p) {
  return H[p] == max(0, h - abs(r-R[p]) - abs(c-C[p]));
}

int solve() {
  int n, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> C[i] >> R[i] >> H[i];
    if (H[i]) x = i;
  }
  for (r = 1; r < 101; r++) {
    for (c = 1; c < 101; c++) {
      h = g(x);
      bool t = true;
      for (int i = 0; i < 100; i++) {
        t &= f(i);
      }
      if (t) return;
    }
  }
}

int main() {
  solve();
  cout << c << " " << r << " " << h << endl;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:30:14: error: return-statement with no value, in function returning 'int' [-fpermissive]
   30 |       if (t) return;
      |              ^~~~~~
a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int n;
int x[101];
int y[101];
int h[101];
int check(int cx, int cy)
{
    int H = 0;
    rep(i, n)
    {
        if (h[i] == 0)
        {
            continue;
        }
        if (H == 0)
        {
            H = h[i] + abs(cx - x[i]) + abs(cy - y[i]);
            break;
        }
    }
    rep(i, n)
    {
        if (h[i] != max((H - abs(cx - x[i]) - abs(cy - y[i])),0)
        {
            return 0;
        }
    }
    return H;
}
int main()
{
    cin >> n;
    rep(i, n)
    {
        cin >> x[i] >> y[i] >> h[i];
    }
    rep(i, 101)
    {
        rep(j, 101)
        {
            int h = check(i, j);
            if (h)
            {
                cout << i << ' ' << j << ' ' << h << endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int check(int, int)':
a.cc:27:65: error: expected ')' before '{' token
   27 |         if (h[i] != max((H - abs(cx - x[i]) - abs(cy - y[i])),0)
      |            ~                                                    ^
      |                                                                 )
   28 |         {
      |         ~                                                        
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e18,MOD=1e9+7;
const int iINF=1e9;
typedef struct{
    ll x,y,h;
} pyramid;
int main(){
    ll n,cx,cy,high,k;
    cin>>n;
    vector<pyramid>p(n);
    for(int i=0;i<n;i++)cin>>p[i].x>>p[i].y>>p[i].h;
    for(int i=0;i<101;i++){//x
        for(int j=0;j<101;j++){//y
            bool flag=true;
            high=0;k=0;
            while(high==0)high=p[++k].h+abs(i-p[k].x)+abs(j-p[k].y);
            for(k=0;(k<n)&&flag;k++){
                if(p[k].h!=max(high-abs(i-p[k].x)-abs(j-p[k].y),0))flag=false;
            }
            if(flag){
                cout<<i<<" "<<j<<" "<<high<<endl;
                return 0;
            }
        }
    }
}
//start 2240

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e18,MOD=1e9+7;
const int iINF=1e9;
typedef struct{
    int x,y,h;
} pyramid;
int main(){
    ll n,cx,cy,high,k;
    cin>>n;
    vector<pyramid>p(n);
    for(int i=0;i<n;i++)cin>>p[i].x>>p[i].y>>p[i].h;
    for(int i=0;i<101;i++){//x
        for(int j=0;j<101;j++){//y
            bool flag=true;
            high=0;k=0;
            while(high==0)high=p[++k].h+abs(i-p[k].x)+abs(j-p[k].y);
            for(k=0;(k<n)&&flag;k++){
                if(p[k].h!=max(high-abs(i-p[k].x)-abs(j-p[k].y),0))flag=false;
            }
            if(flag){
                cout<<i<<" "<<j<<" "<<high<<endl;
                return 0;
            }
        }
    }
}
//start 2240

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

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

struct info {
    int x, y, h;
};

int main() {
    int N;
    info P[100];
    cin >> N;
    for (int i = 0; i < N; i++) cin >> P[i].x >> P[i].y >> P[i].h;
    for (int Cx = 0; Cx <= 100; Cx++) {
        for (int Cy = 0; Cy <= 100; Cy++) {
            int Ch = abs(Cx - P[0].x) + abs(Cy - P[0].y) + P[0].h;
            bool check = true;
            for (int i = 1; i < N; i++) {
                if (abs(Cx - P[i].x) + abs(Cy - P[i].y) + P[i].h != Ch) check = false;
            }
            if (check) {
                cout << Cx << " " << Cy << " " << Ch << endl;
                return 0;
            }
        }
    }

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

#include "bits\stdc++.h"
using namespace std;

struct info {
    int x, y, h;
}

int main() {
    int N;
    info P[100];
    cin >> N;
    for (int i = 0; i < N; i++) cin >> P[i].x >> P[i].y >> P[i].h;
    for (int Cx = 0; Cx <= 100; Cx++) {
        for (int Cy = 0; Cy <= 100; Cy++) {
            int Ch = abs(Cx - P[0].x) + abs(Cy - P[0].y) + P[0].h;
            bool check = true;
            for (int i = 1; i < N; i++) {
                if (abs(Cx - P[i].x) + abs(Cy - P[i].y) + P[i].h != Ch) check = false;
            }
            if (check) {
                cout << Cx << " " << Cy << " " << Ch << endl;
                return 0;
            }
        }
    }
}

Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include "bits\stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
using p = pair<int,int>;
int main(){
	int n;
	cin >> n;

	auto x = vector<int>(n);
	auto y = vector<int>(n);
	auto h = vector<long long>(n);
	
	for (int i = 0; i < n; i++)
	{
      	int a , b, c;
		cin >> a >> b>>C;
      	if(c>=1){
        	x[i] = a;
          	y[i] = b;
          	h[i] = c;
        }
	}

	long long cxx=-1,cyy=-1,hh=-1;
	bool flag= false;
	for (int cx = 0; cx <= 100; cx++)
	{
		for (int cy = 0; cy <= 100; cy++)
		{	
          	long long hb = abs(x[0]-cx)+abs(y[0]-cy)+h[0]; 
			for (int i = 0; i < n; i++)
			{
              	if(h[i] == 0) continue;
              	if(hb<1) break; 
				if(max(hb-abs(x[i]-cx)-abs(y[i]-cy),(long long)0)!=h[i]) break;
				if(i == n-1){
					cxx = cx;
					cyy = cy;
					hh = hb;
					flag = true;
				}
			}
			if(flag) break;
		}
		if(flag) break;
	}
	
	cout << cxx <<" "<<cyy <<" "<<hh;
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: 'C' was not declared in this scope
   15 |                 cin >> a >> b>>C;
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using p = pair<int,int>;
int main(){
	int n;
	cin >> n;

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

	long long cxx=-1,cyy=-1,hh=-1;
	bool flag= false;
	for (int cx = 0; cx <= 100; cx++)
	{
		for (int cy = 0; cy <= 100; cy++)
		{	
          	long long hb = abs(x[0]-cx)+abs(y[0]-cy)+h[0]; 
			for (int i = 0; i < n; i++)
			{
				if(hb<1) break;
				if(max(hb-abs(x[i]-cx)-abs(y[i]-cy),0)!=h[i]) break;
				if(i == n-1){
					cxx = cx;
					cyy = cy;
					hh = hb;
					flag = true;
				}
			}
			if(flag) break;
		}
		if(flag) break;
	}
	
	cout << cxx <<" "<<cyy <<" "<<hh;
	

	
	
}

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

#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007 //S(vector)#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007 //S(vector).size()
#define MAX 100005
#define NIL -1
using namespace std;
typedef long long ll;

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

	for(int posX = 0; posX <= 100; posX++){
		for(int posY = 0; posY <= 100; posY++){
			int tmp = -1;
			int tmp2 = -1;
			bool  flag = true, jud = true;
			for(int i = 0; i < n; i++){
				if(h[i] != 0) tmp = h[i] + abs(posX - x[i]) + abs(posY - y[i]);

				if(tmp != -1 && tmp2 == -1) tmp2 = tmp;
				else {
					if(tmp != tmp2) flag = false;
				}
			}

			if(!flag) continue;

			for(int i = 0; i < n; i++){
				if(h[i] == 0){
					int dist = abs(posX - x[i]) + abs(posY - y[i]);

					if(dist <= h[i]) jud = false;
				}
			}
			if(jud) cout << posX << " " << posY << " " << tmp2;
		}
	}

	return 0;
}
.size()
#define MAX 100005
#define NIL -1
using namespace std;
typedef long long ll;

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

	for(int posX = 0; posX <= 100; posX++){
		for(int posY = 0; posY <= 100; posY++){
			int tmp = -1;
			int tmp2 = -1;
			bool  flag = true, jud = true;
			for(int i = 0; i < n; i++){
				if(h[i] != 0) tmp = h[i] + abs(posX - x[i]) + abs(posY - y[i]);

				if(tmp != -1 && tmp2 == -1) tmp2 = tmp;
				else {
					if(tmp != tmp2) break;
				}
			}

			if(!flag) continue;

			for(int i = 0; i < n; i++){
				if(h[i] == 0){
					int dist = abs(posX - x[i]) + abs(posY - y[i]);

					if(dist < h[i]) jud = false;
				}
			}
			if(jud) cout << posX << " " << posY << " " << tmp2;
		}
	}

	return 0;
}


Compiler output:
a.cc:48:1: error: expected unqualified-id before '.' token
   48 | .size()
      | ^
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main(void){
      |     ^~~~
a.cc:13:5: note: 'int main()' previously defined here
   13 | int main(void){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI 				acos(-1)
#define mp				make_pair
#define pb				push_back
#define all(a)			(a).begin(), (a).end()
#define srt(a)			sort(all(a))
#define mem(a, h)		memset(a, (h), sizeof(a))
#define f 				first
#define s 				second
#define MOD				1000000007
#define MOD1			998244353
#define EPS				1e-9
#define fore(i, b, e)	for(int i = b; i < e; i++)
#define forg(i, b, e, m)	for(int i = b; i < e; i+=m)
int in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
using namespace __gnu_pbds;

typedef long long 		ll;
typedef unsigned long long 		ull;
typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const int tam = 100010;
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	//freopen("qwe.txt", "r", stdin);
	//freopen("asd.txt", "w", stdout);
	int n;
	cin>>n;
	pair<pair<int,int>, int> ar[n];
	fore(i, 0 , n) cin>> ar[i].f.f>>ar[i].f.s>>ar[i].s;
	bool bo;
	int x, y, h;
	fore(i, 0, 101)
		fore(j, 0, 101)
		{
			bo = true;
			x = i, y = j;
			h = abs(x - ar[0].f.f) + abs(y - ar[0].f.s) + ar[0].s;
			fore(k, 0, n)
			{
				if(abs(x - ar[k].f.f) + abs(By - ar[k].f.s) + ar[k].s != h)
				{
					bo = false; break;
				}
			}
			if(bo && h > 0)
			{
				cout<<x<<' '<<y<<' '<<h<<'\n';
				return 0;
			}
		}
	return 0;
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS2

Compiler output:
a.cc: In function 'int main()':
a.cc:49:61: error: 'By' was not declared in this scope; did you mean 'y'?
   49 |                                 if(abs(x - ar[k].f.f) + abs(By - ar[k].f.s) + ar[k].s != h)
      |                                                             ^~
      |                                                             y
Language: C++

#include<iostream>C
#include<vector>
#include<string>
#include<set>
using namespace std;
#define REP(i,m,n) for(int i = m; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a)  (a).rbegin(),(a).rend()
#define dup(x,y) (((x)+(y)-1) / (y)); //整数型のまま切り上げ演算する
#define PI 3.14159265359
typedef long long LL;
template<class T> inline void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> inline T gcd(T x, T y) { if (y == 0) { return x; } else if (x == 0) { return y; }return gcd(y, x % y); }
template<class T> inline T lcm(T x, T y) { return (x * y) / gcd(x, y); }
template<class T> inline vector<T> convert_to_binary_number(T x) { vector<T> binary_num; while (x != 1) { binary_num.push_back(x % 2); x /= 2; } binary_num.push_back(1); return binary_num; }
template<class T> inline void print_vector(vector<T> vec) { for (int i = 0; i < vec.size(); i++) { cout << vec[i] << " "; } cout << endl; }
const LL MOD = 1e9 + 7;
const LL LLINF = 1LL << 60;
const int INF = 1 << 30;

enum {
	X, Y, H
};

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

	vector<vector<LL> > coordinate(N, vector<LL>(3));
	rep(i, N) cin >> coordinate[i][X] >> coordinate[i][Y] >> coordinate[i][H];

	
	for (int x = 0; x <= 100; x++) {
		for (int y = 0; y <= 100; y++) {
			set<LL> st;
			for (int i = 0; i < N; i++) {
				st.insert(coordinate[i][H] + abs(coordinate[i][X] - x) + abs(coordinate[i][Y] - y));
			}

			if (st.size() == 1) {
				cout << x << " " << y << " " << *st.begin() << endl;
			}
		}

	}
	
	return 1;
}


Compiler output:
a.cc:1:9: fatal error: iostream>: No such file or directory
    1 | #include<iostream>C
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <vector>
#include <math.h>
#include <bitset>
#include <cmath>

#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
#define rep_r(i,s,n)for(int i = n-1;i>=0;i--)
#define rep_re(i,s,n)for(int i = n;i>=0;i--)
using namespace std;
typedef long long ll;
static const ll MOD = 1e9 + 7;
static const ll INF = 1e25;
static const ll MAX_N = 100001;
static const ll MAX_M = 100001;

ll x[100] = {};
ll y[100] = {};
ll h[100] = {};

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

	repe(py, 0, 100) repe(px, 0, 100) {
		ll H = h[I] + abs(y[I] - py) + abs(x[I] - px);
		bool same = true;
		rep(i, 0, n) {
			ll nH = h[i] + abs(y[i] - py) + abs(x[i] - px);
			if (h[i] > 0) {
				if (H == nH)continue;
				else break;
			}
			else {
				if (nH != abs(y[i] - py) + abs(x[i] - px)) break;
			}

			if (same) {
				cout << px << " " << py << " " << H << endl;
				return 0;
			}
		}

		return 0;
	}

Compiler output:
a.cc:18:23: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '1.0000000000000001e+25' to '9223372036854775807' [-Woverflow]
   18 | static const ll INF = 1e25;
      |                       ^~~~
a.cc: In function 'int main()':
a.cc:54:10: error: expected '}' at end of input
   54 |         }
      |          ^
a.cc:26:12: note: to match this '{'
   26 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<long,long>
#define INF 1000000000000000000
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<int, int> mp;
//最大公約数
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
class Union_Find {
private:
	vector<int> par;
	vector<int> rank;
public:
	Union_Find(int n) {
		rep(i, n) {
			par.push_back(i);
			rank.push_back(0);
		}
	}
	int find(int x) {
		if (par.at(x) == x) return x;
		else return par.at(x) = find(par.at(x));
	}
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) return;
		if (rank.at(x) < rank.at(y)) {
			par.at(x) = y;
		}
		else {
			par.at(y) = x;
			if (rank.at(x) == rank.at(y)) rank.at(x)++;
		}
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
};
long long N, X[1009], Y[1009], H[1009]; vector<tuple<long long, long long, long long>>vec;
 
int main() {
	cin >> N; tuple<long long, long long, long long>G = make_tuple(-1, -1, -1);
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i] >> H[i];
		if (H[i] >= 1) G = make_tuple(X[i], Y[i], H[i]);
	}
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			long long V = get<2>(G) + abs(get<0>(G) - i) + abs(get<1>(G) - j); V = max(V, 0LL); bool flag = true;
			for (int k = 1; k <= N; k++) {
				long long VV = V - abs(X[k] - i) - abs(Y[k] - j); VV = max(VV, 0LL);
				if (H[k] != VV) flag = false;
			}
			if (flag == true) vec.push_back(make_tuple(i, j, V));
		}
	}
	if (vec.size() == 1) {
		cout << get<0>(vec[0]) << " " << get<1>(vec[0]) << " " << get<2>(vec[0]) << endl;
	}
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
  int a,h,c=0,d,e;
  cin>>a;
  vector<vector<int>> b(a,vector<int>(3));
  for(int i=0;i<a;i++){
    for(int j=0;j<3;j++)
      cin>>b.at(i).at(j);
  }
  for(int i=0;i<=100;i++){
    for(int j=0;j<=100;j++){
      h=b.at(0).at(2)+abs(b.at(0).at(0)-i)+abs(b.at(0).at(1)-j);
      for(int k=0;k<a;k++){
        if(h!=b.at(k).at(2)+abs(b.at(k).at(0)-i)+abs(b.at(k).at(1)-j);)
          break;
        if(k==a-1){
          c=1;
          d=i,e=j;
        }
      }
      if(c==1)
        break;
    }
    if(c==1)
      break;
  }
  cout<<d<<' '<<e<<' '<<h<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:71: error: expected primary-expression before ')' token
   16 |         if(h!=b.at(k).at(2)+abs(b.at(k).at(0)-i)+abs(b.at(k).at(1)-j);)
      |                                                                       ^
Language: C++

#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
using namespace std;
typedef long long ll;

int main()
{
    int N;
    cin >> N;
    ll source[N][3];
    for(int i=0; i<N; i++){
        cin >> source[i][0] >> source[i][1] >> source[i][2];
    }
    
    for(int x=0; x<=100; x++){
        for(int y=0; y<=100; y++){
            bool flag=true;
            int cnt=0;
            ll h;
            ll tmp_h=-1;
            for(int n=0; n<N; n++){
                if(source[i][2]==0) continue;
                if(cnt==0){
                    h=source[n][2]+abs(source[n][0]-x)+abs(source[n][1]-y);
                    if(h<=0) continue;
                    cnt++;
                    continue;
                }
                tmp_h=source[n][2]+abs(source[n][0]-x)+abs(source[n][1]-y);
                if(tmp_h<=0) continue;
                
                if(tmp_h!=h){
                    flag=false;
                    break;
                }
            }
            
            if(flag){
                cout << x << ' ' << y << ' ' << h << endl;
                return 0;
            }
        }
    }


    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: 'i' was not declared in this scope
   31 |                 if(source[i][2]==0) continue;
      |                           ^
Language: C++

#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
using namespace std;
typedef long long ll;

int main()
{
    int N;
    cin >> N;
    ll source[N][3];
    for(int i=0; i<N; i++){
        cin >> source[i][0] >> source[i][1] >> source[i][2];
    }
    
    for(int x=0; x<=100; x++){
        for(int y=0; y<=100; y++){
            if(N==1){
                cout << source[0][0] << ' ' << source[0][1] << ' ' << abs(source[0][0])+abs(source[n][1]) << endl;
            }
            bool flag=true;
            int cnt=0;
            ll h;
            ll tmp_h=-1;
            for(int n=0; n<N; n++){
                if(source[n][2]==0) continue;
                if(cnt==0){
                    h=source[n][2]+abs(source[n][0]-x)+abs(source[n][1]-y);
                    cnt++;
                    continue;
                }
                tmp_h=source[n][2]+abs(source[n][0]-x)+abs(source[n][1]-y);
                
                if(tmp_h!=h){
                    flag=false;
                    break;
                }
            }
            
            if(flag){
                cout << x << ' ' << y << ' ' << h << endl;
                return 0;
            }
        }
    }


    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:100: error: 'n' was not declared in this scope
   27 |                 cout << source[0][0] << ' ' << source[0][1] << ' ' << abs(source[0][0])+abs(source[n][1]) << endl;
      |                                                                                                    ^