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

#include <iostream>
#include <climits>
#include <algorithm>
#include <cstdlib>  // abs() for integer
#include <vector>
#include <tuple>

using namespace std;

long long N, X[1009], Y[1009], H[1009];
vector <tuple<long long, long long, long long>>vec;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
//    ダメだったやつ
//    int n;
//    cin >> n;
//    int x_c[n], y_c[n], height[n];
//
//    for(int i=0; i<n; i++){
//        cin >> x_c[i] >> y_c[i] >> height[i];
//    }
//
//    int c_x, c_y, trueheight = 100000;
//    bool flag = true;
//    for(int x=0; x<=100; x++){
//        for(int y=0; y<=100; y++){
//            int tmp_1;
//            int tmp_2;
//            for(int i=0; i<n-1; i++){
//                tmp_1 = height[i] + abs(x_c[i] - x) + abs(y_c[i] - y);
//                tmp_2 = height[i+1] + abs(x_c[i+1] - x) + abs(y_c[i+1] - y);
//                if(tmp_1 != tmp_2) {
//                    break;
//                }
//            }
//            if(trueheight > tmp_1){
//                c_x = x;
//                c_y = y;
//                trueheight = tmp_1;
//            }
//        }
//    }
//    cout << c_x << ' ' << c_y << ' ' << trueheight << '\n';

    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], Z[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;
            }
            jf(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:
a.cc: In function 'int main()':
a.cc:53:50: error: 'Z' was not declared in this scope
   53 |         if(H[i] >= 1) G = make_tuple(X[i], Y[i], Z[i]);
      |                                                  ^
a.cc:60:29: error: 'k' was not declared in this scope
   60 |             for (int K = 1; k <= N; k++) {
      |                             ^
a.cc:65:13: error: 'jf' was not declared in this scope; did you mean 'j'?
   65 |             jf(flag == true)
      |             ^~
      |             j
Language: C++

#include<bits/stdc++.h>
using namespace std;
int x[200], y[200], h[200], N;
void check(int X, int Y){
  int H = abs(X - x[0]) + abs(Y - y[0]) + h[0];
  if(H){
    for(int i = 1; i < N; i += 1)
      if(abs(X - x[i]) + abs(Y - y[i]) + h[i] != H) return;
    cout << X << " " << Y << " " << H;
    exit(0);
  }
}
int main(){
  cin >> N;
  for(int i = 0; i < N; i += 1)
    cin >> x[i] >> y[i] >> h[i];
  for(int x = 0; x <= 100; i += 1)
    for(int y = 0; y <= 100; i += 1)
      check(x, y);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'i' was not declared in this scope
   17 |   for(int x = 0; x <= 100; i += 1)
      |                            ^
Language: C++

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

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())
#define AsceSort(a) sort(a.begin(),a.end())

using namespace std;
typedef long long ll;

int main(void) {
	int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
	long long x[1005], y[1005], h[1005];
	int ansx, ansy, ansh;
	cin >> n;
	REPS(i, n) {
		cin >> x[i] >> y[i] >> h[i];
	}
	//[0,100]に座標があるのでMAXを定義すると楽
	int MAX = 100;
	for (int i = 0; i <= MAX; i++) {
		for (int j = 0; j <= MAX; j++) {
			//頂上がどのくらいの高さであってほしいか
			//-1はまだよくわからないとき。0以上は確定してるとき
			//-2はダメだってわかった時
			int needH = -1;
			REP(k, n) {
				if (h[i] > 0) {
					//この頂点から見て、頂上がi,jの時に
					//どれくらいの高さがあってほしいか求める
					int tmp = h[i] + abs(j - y[k]) + abs(i - x[k]);
					if (needH == -1) {
						needH = tmp;
					}
					else {
						if (needH != tmp) {
							needH = -2;
							break;
						}
					}
				}
			}
			//ダメだったら別の場所を探す
			if (needH == -2) continue;
			for (int k = 0; k < n; k++) {
				//高さが0の場合に矛盾してないか調べる
				if (h[i] == 0) {
					int dist= abs(j - y[k]) + abs(i - x[k]);
					if (needH > dist) {
						needH = -2;
						break;
					}
				}
			}
			if (needH == -2) continue;
			//見つけられたら答えをそのまま返す
			cout << i << " " << j << " " << needH << endl;
			return 0;
		}
	}
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:22:53: error: invalid declarator before 'G'
   22 |         int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
      |                                                     ^
Language: C++

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

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())
#define AsceSort(a) sort(a.begin(),a.end())

using namespace std;
typedef long long ll;

vector<tuple<long long, long long, long long>>vec;

int main(void) {
	int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
	long long x[1005], y[1005], h[1005];
	int ansx, ansy, ansh;
	cin >> n;
	REPS(i, n) {
		cin >> x[i] >> y[i] >> h[i];
	}
	//[0,100]に座標があるのでMAXを定義すると楽
	int MAX = 100;
	for (int i = 0; i <= MAX; i++) {
		for (int j = 0; j <= MAX; j++) {
			//頂上がどのくらいの高さであってほしいか
			//-1はまだよくわからないとき。0以上は確定してるとき
			//-2はダメだってわかった時
			int needH = -1;
			REP(k, n) {
				if (h[i] > 0) {
					//この頂点から見て、頂上がi,jの時に
					//どれくらいの高さがあってほしいか求める
					int tmp = h[i] + abs(j - y[k]) + abs(i - x[k]);
					if (needH == -1) {
						needH = tmp;
					}
					else {
						if (needH != tmp) {
							needH = -2;
							break;
						}
					}
				}
			}
			//ダメだったら別の場所を探す
			if (needH == -2) continue;
			for (int k = 0; k < n; k++) {
				//高さが0の場合に矛盾してないか調べる
				if (h[i] == 0) {
					int dist= abs(j - y[k]) + abs(i - x[k]);
					if (needH > dist) {
						needH = -2;
						break;
					}
				}
			}
			if (needH == -2) continue;
			//見つけられたら答えをそのまま返す
			cout << i << " " << j << " " << needH << endl;
			return 0;
		}
	}
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:24:53: error: invalid declarator before 'G'
   24 |         int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
      |                                                     ^
Language: C++

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

#define REP(i,n) for(int i=0;i<(int)n;i++)
#define REP1(j,n) for(int j=0;j<(int)n;j++)
#define REPD(i,n) for(int i=n;i>=0;i--)
#define REPD1(j,n) for(int j=n;j=>0;j--)
#define REPS(i,n) for(int i=1;i<=(int)n;i++)
#define REPS1(j,n) for(int j=1;j<=(int)n;j++)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define DescSort(a) sort(a.begin(),a.end(),std::greater<int>())
#define AsceSort(a) sort(a.begin(),a.end())

using namespace std;
typedef long long ll;

vector<tuple<long long, long long, long long>>vec;

int main(void) {
	int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
	long long x[1005], y[1005], h[1005];
	int ansx, ansy, ansh;
	cin >> n;
	REPS(i, n) {
		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:
a.cc: In function 'int main()':
a.cc:24:53: error: invalid declarator before 'G'
   24 |         int n,tuple<long long, long long, long long>G=make_tuple(-1,-1,-1);
      |                                                     ^
a.cc:30:31: error: 'G' was not declared in this scope
   30 |                 if (h[i] >= 1)G = make_tuple(x[i], y[i], h[i]);
      |                               ^
a.cc:34:46: error: 'G' was not declared in this scope
   34 |                         long long V = get<2>(G) + abs(get<0>(G) - i) + abs(get<1>(G) - j); V = max(V, 0LL);
      |                                              ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
long long gcd(long long a,long long b){if(a%b==0){return b;}else return gcd(b,a%b);}
long long lcm(long long a,long long b){if(a==0){return b;} return a/gcd(a,b)*b;}
#define MOD 1000000007
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 1
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll

// C
signed main(){
  cin>>n;
  int h=-1;
  for(int i=0; i<n; i++){
    int a,b,c; cin>>a>>b>>c;
    p[i].first=a; p[i].second=b; height[i]=c;
    if(c>0) h=i;
  }

  for(int i=0; i<=100; i++){
    for(int j=0; j<=100; j++){
      int ans=abs(p[h].first-i)+abs(p[h].second-j)+height[h];
      bool ok=true;
      for(int k=1; k<n; k++){
        if(height[k]!=max(ans-abs(p[h].first-i)-abs(p[h].second-j),(int)0)) ok=false;
      }
      if(ok){
        cout<<i<<" "<<j<<" "<<ans<<en;
      }
    }
  }
}





Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   43 |   cin>>n;
      |        ^
      |        yn
a.cc:47:5: error: 'p' was not declared in this scope
   47 |     p[i].first=a; p[i].second=b; height[i]=c;
      |     ^
a.cc:47:34: error: 'height' was not declared in this scope
   47 |     p[i].first=a; p[i].second=b; height[i]=c;
      |                                  ^~~~~~
a.cc:53:19: error: 'p' was not declared in this scope
   53 |       int ans=abs(p[h].first-i)+abs(p[h].second-j)+height[h];
      |                   ^
a.cc:53:52: error: 'height' was not declared in this scope
   53 |       int ans=abs(p[h].first-i)+abs(p[h].second-j)+height[h];
      |                                                    ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
int main() {
	int n, p = -1,i,X,Y; cin >> n;
	int x[105], y[105], h[105];
	for (i=0;i<n;i++) {
		cin >> x[i] >> y[i] >> h[i];
		if (h[i] != 0)p = i;
	}
	for (X = 0; X <= 100; X++) {
		for (Y = 0; Y <= 100; Y++) {
			int H = abs(x[p] - X) + abs(y[p] - Y) + h[p];
			if (H <= 0)continue;
			bool flag = 1;
			for (i = 0; i < n; i++)
				if (h[i] != max(H - abs(X - x[i]) - abs(Y - y[i]), (int)0))flag = 0;
			if (flag) {
				cout << X << ' ' << Y << ' ' << H << endl;
				cin >> n;
				return 0;
			}
		}
	}
}

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

#include<bits/stdc++.h>
#define ll long long
using namespace std;
signed main() {
	ll n, p = -1,i,X,Y; cin >> n;
	ll x[105], y[105], h[105];
	for (i=0;i<n;i++) {
		cin >> x[i] >> y[i] >> h[i];
		if (h[i] != 0)p = i;
	}
	for (X = 0; X <= 100; X++) {
		for (Y = 0; Y <= 100; Y++) {
			ll H = abs(x[p] - X) + abs(y[p] - Y) + h[p];
			if (H <= 0)continue;
			bool flag = 1;
			for (i = 0; i < n; i++)
				if (h[i] != max(H - abs(X - x[i]) - abs(Y - y[i]), (int)0))flag = 0;
			if (flag) {
				cout << X << ' ' << Y << ' ' << H << endl;
				cin >> n;
				return 0;
			}
		}
	}
}

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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a;
	ll x[114], y[114], h[114];
	cin>>n;
	REP(i, n){
		cin>>x[i]>>y[i]>>h[i];
		if(h[i]>0){
			a=i;
		}
	}
	for(ll c1=0; c1<=100; ++c1){
		for(ll c2=0; c2<=100; ++c2){
			for(H=h[a]; H<=h[a]+200; ++H){
				bool ok=false;
				REP(i, n){
					if(h[i]){
						if(H!=h[i]+abs(x[i]-c1)+abs(y[i]-c2)){
							ok=false;
							i=n;
						}
					}
					else if(H>abs(x[i]-c1)+abs(y[i]-c2)){
						ok=false;
						i=n;
					}
				}
				if(ok){
					cout<<c1<<' '<<c2<<' '<<H<<'\n';
					return 0;
				}
			}
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:29: error: 'H' was not declared in this scope
   45 |                         for(H=h[a]; H<=h[a]+200; ++H){
      |                             ^
Language: C++

def calcCh(cx, cy, x, y, h):
    return abs(x-cx)+abs(y-cy)+h
def calcH(cx, cy, ch, x, y, h):
    return max(ch - calcCh(cx, cy, x, y, 0), 0)
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
xyh = sorted(xyh, key = lambda x: x[2])[::-1]
lst = [[x, y] for x in range(101) for y in range(101)]
for Cx, Cy in lst:
    Ch = calcCh(Cx, Cy, *xyh[0])
    if all(xyh[i][2] == calcH(Cx, Cy, Ch, *xyh[i]) for i in range(n)):
        break
print(Cx, Cy, Ch)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def calcCh(cx, cy, x, y, h):
      | ^~~
Language: C++

#include "iostream"
using namespace std;

int main() {
  int n, fix, x[110], y[110], h[110];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> h[i];
    if (h[i] != 0) fix = i;
  }

  bool ans = true;

  for (int a = 0; a < 101; a++) {
    for (int b = 0; b < 101; b++) {
      for (int hi = max(h[fix] - 205, 0); hi < h[fix] + 205; hi++) {
        ans = true;
        for (int k = 0; k < n; k++) {
          if (h[k] != max(hi - abs(x[k] - a) - abs(y[k] - b), 0)) ans = false;
        }
        if (ans) cout << a << " " << b << " " << hi << endl;
        }
      }
    }
  }
}

Compiler output:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int N;
ll X[100],Y[100],H[100];


ll cal(int a,int b,int c,int d)
{
	return -abs(a-b)-abs(c-d);
}

bool ch(ll x,ll y,ll h)
{

	{
		for(int i=0;i<N;i++)
		{
			bool a=H[i]==h-abs(X[i]-x)-abs(Y[i]-y);
			if(!a)return false;
		}
	}
	return true;
}

void main()
{
	ll mx=101,my=101,mxx=0,mxy=0;
	cin>>N;
	for(int i=0;i<N;i++)
	{
		cin>>X[i]>>Y[i]>>H[i];
		mx=min(mx,X[i]);
		my=min(my,Y[i]);
		mxx=max(mxx,X[i]);
		mxy=max(mxy,Y[i]);
	}
	if(N==1)
		cout<<X[0]<<" "<<Y[0]<<" "<<H[0]<<endl;
	else
	{
		for(int i=0;i<=100;i++)
			for(int j=0;j<=100;j++)
			{
				int h=H[i]+abs(X[0]-i)+abs(Y[0]-j);
				if(ch(i,j,h))
				{
					cout<<i<<" "<<j<<" "<<h<<endl;
					//return;
				}
			}
	}
	return;
}


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

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

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

	for (int posy = 0; posy < 101; posy++) {
		for (int posx = 0; posx < 101; posx++) {
			int H = -1;
			for (int i = 0; i < n; i++) {
				if (h[i] > 0) {
					int temp = h[i] + abs(posx - x[i]) + abs(posy - y[i]);
					if (H == -1) {
						H = temp;
					}
					else {
						if (H != temp) {
							H = -2;
							break;
						}
					}
				}
			}
			if (H == -2) {
				continue;
			}
			for (int i = 0; i < n; i++) {
				if (h[i] == 0) {
					int temp = abs(posx - x[i]) - abs(posy - y[i]);
					if (H > temp) {
						temp = -2;
						break;
					}
				}
			}
			if (H == -2) continue;

			cout << posX << " " << posY << " " << H << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: 'i' was not declared in this scope
    8 |         int x[n], y[n], h[i];
      |                           ^
a.cc:9:60: error: 'h' was not declared in this scope
    9 |         for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> h[i];
      |                                                            ^
a.cc:15:37: error: 'h' was not declared in this scope
   15 |                                 if (h[i] > 0) {
      |                                     ^
a.cc:32:37: error: 'h' was not declared in this scope
   32 |                                 if (h[i] == 0) {
      |                                     ^
a.cc:42:33: error: 'posX' was not declared in this scope; did you mean 'posx'?
   42 |                         cout << posX << " " << posY << " " << H << endl;
      |                                 ^~~~
      |                                 posx
a.cc:42:48: error: 'posY' was not declared in this scope; did you mean 'posy'?
   42 |                         cout << posX << " " << posY << " " << H << endl;
      |                                                ^~~~
      |                                                posy
Language: C++

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

using namespace std;

struct ta {
    long long x, y, h;
}t[100];

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

    long long maxx = 0, temp;
    ta ans;
    bool p;

    for (long long i = 0; i <= 100; ++i) {
        for (long long j = 0; j <= 100; ++j) {
            for (long long k = 0; k < n; ++k) {
                if (t[k].h != 0) {
                    temp = t[k].h + abs(i - t[k].x) + abs(j - t[k].y);
                    maxx = k;
                    break;
                }
            }

            p = true;
            for (long long k = maxx + 1; k < n; ++k) {
                if (t[k].h == 0) {
                    if (temp - abs(i - t[k].x) - abs(j - t[k].y) > 0) {
                        p = false;
                        break;
                    }
                }
                if (t[k].h != 0 && t[k].h + abs(i - t[k].x) + abs(j - t[k].y) != temp) {
                    p = false;
                    break;
                }
            }

            if (p) {
                ans.h = temp;
                anx.x = i;
                ans.y = j;
            }
        }
    }
    cout << ans.x << " " << ans.y << " " << ans.h <<endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:49:17: error: 'anx' was not declared in this scope; did you mean 'ans'?
   49 |                 anx.x = i;
      |                 ^~~
      |                 ans
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

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

    vector <int> X(no_of_points + 1);
    vector <int> Y(no_of_points + 1);
    vector <int> height(no_of_points + 1);
    for(int i = 1; i <= no_of_points; i++)
        scanf("%d %d %d", &X[i], &Y[i], &height[i]);
        
    int non_zero;
    for(int i = 1; i <= no_of_points; i++)
        if(height[i] != 0)
            non_zero = i;

    const int MAX_X = 100, MAX_Y = 100;
    int pyramid_height, center_x, center_y;

    for(int x = 0; x <= MAX_X; x++)
    {
        for(int y = 0; y <= MAX_Y; y++)
        {
            int no_of_heights = 1;

            for(int i = 1; i <= no_of_points; i++)
            {
                if(height[i] == 0) continue;

                if(height[i] + abx(X[i] - x) + abs(Y[i] - y) != height[non_zero] + abs(X[non_zero] - x) + abs(Y[non_zero] - y))
                {
                    no_of_heights++;
                }
            }

            if(no_of_heights == 1)
            {
                center_x = x, center_y = y;

                pyramid_height = height[non_zero] + abs(X[non_zero] - x) + abs(Y[non_zero] - y);
            }
        }
    }

    printf("%d %d %d\n", center_x, center_y, pyramid_height);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:32: error: 'abx' was not declared in this scope; did you mean 'abs'?
   37 |                 if(height[i] + abx(X[i] - x) + abs(Y[i] - y) != height[non_zero] + abs(X[non_zero] - x) + abs(Y[non_zero] - y))
      |                                ^~~
      |                                abs
Language: C++

#include<bits/stdc++.h>
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];
    }
    
    
    
    for(int i=0;i<101;i++)
    {
        for(int j=0;j<101;j++)
        {
        
            int H;
            for(int k=0;k<n;k++)
            {
                if(h[k]>0)
                {
                H=h[k]+(abs(x[k]-i))+abs(y[k]-j));
                break;
                
                }
            }
            int c=0;
            if(int k=0;k<n;k++)
            {
                int h=(H-(abs(x[k]-i))-abs(H-(abs(y[k]-j))));
                if(h!=h[k])
                {
                    break;
                }
                c++;
            
            }
            
            if(c==n)
            {
                cout<<i<<" "<<j<<" "<<H<<"\n";
            }
        
        
        }
    
    
    }


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:49: error: expected ';' before ')' token
   27 |                 H=h[k]+(abs(x[k]-i))+abs(y[k]-j));
      |                                                 ^
      |                                                 ;
a.cc:33:27: error: expected ')' before ';' token
   33 |             if(int k=0;k<n;k++)
      |               ~           ^
      |                           )
a.cc:33:28: error: 'k' was not declared in this scope
   33 |             if(int k=0;k<n;k++)
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
vector<int> x, y, h;
bool flag = false;
int main() {
	cin >> N;
	REP(i, N) {
		int xs, ys, hs;
		cin >> xs >> ys >> hs;
		x.push_back(xs);
		y.push_back(ys);
		h.push_back(hs);
	}

  for (ll k = 0;k < n;k++) {
		if (h[k] > 0) {
			for (ll i = 0;i <= 100;i++) {
				for (ll j = 0;j <= 100;j++) {
					ll H = h[k] + abs(x[k] - i) + abs(y[k] - j);
					bool flag = true;
					for (ll l = 0;l < n;l++) {
						if (h[l] != max(H - abs(x[l] - i) - abs(y[l] - j), (ll)0))flag = false;
					}
					if (flag) {
						cout << i << " " << j << " " << H << endl;
						return 0;
					}
				}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
    9 |         REP(i, N) {
      |             ^
a.cc:9:9: error: 'REP' was not declared in this scope
    9 |         REP(i, N) {
      |         ^~~
a.cc:17:21: error: 'n' was not declared in this scope
   17 |   for (ll k = 0;k < n;k++) {
      |                     ^
Language: C++

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


int n,OK;//n点的个数，OK（是否找到）控制循环停止
int x[105] , y[105] , h[105] ;//存数据
int sum, ri, hi;//sum（差的和）用于计算hi（假定高度）
int hh,hh_n;
int main(){
	scanf("%d ",&n);
	for(int i = 1 ; i <= n ; i++){
		scanf("%d %d %d", &x[i] , &y[i] , &h[i] );
		if(h[i])	hh_n=i;
	}

	for(int i=0 ; i<=100 && OK==0 ; i++ ){

		for(int j=0 ; j<=100 && OK==0 ; j++ ){//枚举坐标

			sum = abs( x[hh_n]-i )+ abs( y[hh_n]-j );
			hi  = h[hh_n] + sum;//算出假定高度
			ri=0;
			for( int k=1 ; k<=n ; k++ ){
				sum = abs( x[k]-i ) + abs( y[k]-j );
				

Compiler output:
a.cc: In function 'int main()':
a.cc:24:69: error: expected '}' at end of input
   24 |                                 sum = abs( x[k]-i ) + abs( y[k]-j );
      |                                                                     ^
a.cc:23:52: note: to match this '{'
   23 |                         for( int k=1 ; k<=n ; k++ ){
      |                                                    ^
a.cc:24:69: error: expected '}' at end of input
   24 |                                 sum = abs( x[k]-i ) + abs( y[k]-j );
      |                                                                     ^
a.cc:18:54: note: to match this '{'
   18 |                 for(int j=0 ; j<=100 && OK==0 ; j++ ){//枚举坐标
      |                                                      ^
a.cc:24:69: error: expected '}' at end of input
   24 |                                 sum = abs( x[k]-i ) + abs( y[k]-j );
      |                                                                     ^
a.cc:16:46: note: to match this '{'
   16 |         for(int i=0 ; i<=100 && OK==0 ; i++ ){
      |                                              ^
a.cc:24:69: error: expected '}' at end of input
   24 |                                 sum = abs( x[k]-i ) + abs( y[k]-j );
      |                                                                     ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

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


int n,OK;//n点的个数，OK（是否找到）控制循环停止
int x[105] , y[105] , h[105] ;//存数据
int sum, ri, hi;//sum（差的和）用于计算hi（假定高度）
int hh,hh_n;
int main(){
	scanf("%d ",&n);
	for(int i = 1 ; i <= n ; i++){
		scanf("%d %d %d", &x[i] , &y[i] , &h[i] );
		if(h[i])	hh_n=i;
	}

	for(int i=0 ; i<=100 && OK==0 ; i++ ){

		for(int j=0 ; j<=100 && OK==0 ; j++ ){//枚举坐标

			sum = abs( x[hh_n]-i )+ abs( y[hh_n]-j );
			hi  = h[hh_n] + sum;//算出假定高度
			right=0;
			for( int k=1 ; k<=n ; k++ ){
				sum = abs( x[k]-i ) + abs( y[k]-j );
				if( h[k] == max(hi - sum, 0)) ri++;//满足假定高度++
			}

			if( ri == n ){//所有的点都满足假定高度
				printf("%d %d %d",i,j,hi);
				OK = 1;
			}
		}
	}	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:30: error: assignment of function 'std::ios_base& std::right(ios_base&)'
   22 |                         right=0;
      |                         ~~~~~^~
Language: C++

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

int main(void){
    int n, x[110], y[110], h[110], ans[110];
    cin >> 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){
            for(int k=0;k<n;++k){
                if(h[k]==0) continue;
                ans[k] = h[k] + abs(i-x[k]) + abs(j-y[k]);
            }
            int flg = 1;
            for(int k=1;k<n;++k){
                if(ans[k] != ans[k-1]){
                    flg=0;
                    break;
                }
            }
            if(flg){
                int nflg = 1;
                for(int k=0;k<n;++k){
                    if(max(ans[0] - abs(x[k]-i) - abs(y[k]-j), 0) != h[k]){
                        nflg = 0;
                        break;
                    }
                }
                if(nflg){
                    cout << i << " " << j << " " << ans[0] << endl;
                    return;
                }
            }
        }
    }
}

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

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

int main()
{
	ios::sync_with_stdio(false);
	int num, time, i, j, k, rec, cx, cy, height,he;
	cin >> num;
	int x[num], y[num], h[num];
	for (i = 0; i < num; i++)cin >> x[i] >> y[i] >> h[i];
	rec=-1
	for (i = 0; i < num; i++) {
		if (h[num] != 0) {
			rec = i;
			break;
		}
	}
		for (i = 0; i <= 100; i++) {
			for (j = 0; j <= 100; j++) {
				time = 0;
				height = h[rec] + abs(i - x[rec]) + abs(j - y[rec]);
				for (k = 0; k < num; k++) {
					if (h[k] == max((height - abs(i - x[k]) - abs(j - y[k])), 0)) time++;
				}
				if (time == num) {
					cx = i;
					cy = j;
					he = height;
					break;
				}
			}
			if (time == num)break;
		}

		cout << cx << " " << cy << " " << he;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before 'for'
   12 |         rec=-1
      |               ^
      |               ;
   13 |         for (i = 0; i < num; i++) {
      |         ~~~    
a.cc:13:33: error: expected ';' before ')' token
   13 |         for (i = 0; i < num; i++) {
      |                                 ^
      |                                 ;
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>

typedef long long ll;
using namespace std;

int main()
{
    int n;
    ll x[100], y[100], cx, cy, H;
    ll h[100], tmp1,tmp2;
    cin >> n;

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

    }
 
    for(ll i=0; i<=100; i++){
        for(ll j=0; j<=100; j++){
            for(int k=0; k<n; k++){
                if(h[k] > 0){
                    H = h[k] + abs(x[k]-i) + abs(y[k]-j);
                    break;
                }
}
            bool check = true;
            for (ll k=0;k<n;k++) {
                if (max(H-abs(x[k]-i)-abs(y[k]-j),(ll)0)!=h[k]) {check=false;break;}
            }
            if (check) {
                cout << i << ' ' << j << ' ' << H << endl;
                return 0;
                }
            }
        }
    }
}

Compiler output:
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>

typedef long long ll;
using namespace std;

int main()
{
    int n;
    ll x[100], y[100], cx, cy, H;
    ll h[100], tmp1,tmp2;
    cin >> n;

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

    }
 
    for(ll i=0; i<=100; i++){
        for(ll j=0; j<=100; j++){
            for(int k=0; k<n; k++){
                if(h[k] > 0){
                    H = h[k] + abs(x[k]-i) + abs(y[k]-j);
                    break;
                }
            bool check = true;
            for (ll k=0;k<n;k++) {
                if (max(H-abs(x[k]-i)-abs(y[k]-j),(ll)0)!=h[k]) {check=false;break;}
            }
            if (check) {
                cout << i << ' ' << j << ' ' << H << endl;
                return 0;
                }
            }
        }
    }

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

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string.h>
#include <vector>
#include <cmath>
#include <iostream>
#include <unordered_map>
#include <queue>
using namespace std;
typedef unsigned long long ui64;
typedef long long i64;

void Pyramid() {
	int N;
	cin >> N;
	int x[101];
	int y[101];
	int h[101];
	for (size_t i = 0; i < N; i++)
	{
		cin >> x[i] >> y[i] >> h[i];
	}
	for (int i = 0; i <= 100; i++)
	{
		for (int j = 0; j <= 100; j++)
		{
			int tmp = 0;
			for (int k = 0; k < N; k++)
			{
				if (h[k] == 0) continue;
				tmp = h[k] + abs(x[k] - i) + abs(y[k] - j);
				break;
			}
			for (int k = 0; k < N; k++)
			{
				if (max((tmp - abs(x[k] - i) - abs(y[k] - j)),0) != h[k]) break;
			}
			if (N == k) {
				cout << i << " " << j << " " << tmp << "\n";
				return;
			}
		}
	}

}
 int main() {
	 Pyramid();
	 return 0;
}

Compiler output:
a.cc: In function 'void Pyramid()':
a.cc:43:34: error: 'k' was not declared in this scope
   43 |                         if (N == k) {
      |                                  ^
Language: C++

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP0(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define RREP0(i,n) for(int i=n-1; i>=0; --i)
#define RREP1(i,n) for(int i=n; i>=1; --i)

#define SORT(c) sort((c).begin(),(c).end())
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define CLR(a) memset((a), 0 ,sizeof(a))

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int INTINF = 2147483647;
const LL LLINF = 9223372036854775807;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int WHITE = 0;
const int GRAY = 1;
const int BLACK = 2;
const int MAX = 101;
int N=0;
VI pos[MAX];

struct init{
    init(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
} init;


void input(){
  std::cin >> N;
  int x, y, h;
  int j=0;
  REP0( i, N ){
    pos[j].PB(x); pos[j].PB(y); pos[j].PB(h);
  }
}

void solve(){
  REP0( px, 101 ){
    REP0( py, 101 ){
      REP0( i, N ){
        if ( pos[i][2]!=0 ) {
          int H = pos[i][2] + abs( pos[i][0] - px ) + abs( pos[i][1] - py );
          break;
        }
      }
      bool isAnswer = true;
      REP0( i, N ){
          int H_tmp = pos[i][2] + abs( pos[i][0] - px ) + abs( pos[i][1] - py );
          if ( H_tmp != H ) {
            isAnswer = false;
          }
        }
      if ( isAnswer ) {
        std::cout << px << " " << py << " " << H << '\n';
        return;  
      }
    }
  }
}


int main(int argc, char const *argv[]) {
  input();
  solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:67:25: error: 'H' was not declared in this scope
   67 |           if ( H_tmp != H ) {
      |                         ^
a.cc:72:48: error: 'H' was not declared in this scope
   72 |         std::cout << px << " " << py << " " << H << '\n';
      |                                                ^
Language: C

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


int n,OK;//n点的个数，OK（是否找到）控制循环停止
int x[105] , y[105] , h[105] ;//存数据
int sum, ri, hi;//sum（差的和）用于计算hi（假定高度）

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

	for(int i=0 ; i<=100 && OK==0 ; i++ ){

		for(int j=0 ; j<=100 && OK==0 ; j++ ){//枚举坐标

			sum = abs( x[1]-i )+ abs( y[1]-j );
			hi  = h[1] + sum;//算出假定高度
			ri = 1;//验证每个点是否符合假定高度

			for( int k=2 ; k<=n ; k++ ){
				sum = abs( x[k]-i ) + abs( y[k]-j );
				if( h[k] == max(hi - sum, 0)) ri++;//满足假定高度++
			}

			if( ri == n ){//所有的点都满足假定高度
				printf("%d %d %d",i,j,hi);
				OK = 1;
			}
		}
	}	
}



Compiler output:
main.c: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>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;
long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h[ohara],w,x[ohara],y[ohara],sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
  
       cin.tie(0);
    ios::sync_with_stdio(false);
      
      cin>>n;
      rep(i,n)cin>>x[i]>>y[i]>>h[i];
      rep(Cx,101){
        rep(Cy,101){
          map<ll,ll> mp;
          ll data[ohara];
          cnt=0;
          rep(i,n){
            if(h[i]!=0){
              pos=abs(x[i]-Cx)+abs(y[i]-Cy);
              mp[pos+h[i]]++;
              data[cnt++]=pos+h[i];
            }
            else{
              pos=abs(x[i]-Cx)+abs(y[i]-Cy);
              ma=max(ma,pos);
              rep(j,pos+1)mp[j]++,data[cnt++]=j;
            }
          }
          rep(i,cnt){
            if(mp[data[i]]==n){
              cout<<Cx<<" "<<Cy<<" "<<i<<"\n";
              return 0;
            }
          }
        }
      }
    
       
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:15: error: 'ma' was not declared in this scope; did you mean 'mp'?
   46 |               ma=max(ma,pos);
      |               ^~
      |               mp
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>

typedef long long ll;
using namespace std;

int main()
{
    int n;
    ll x[100], y[100], cx, cy;
    ll h[100], tmp1,tmp2;
    cin >> n;

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

    }
 
    for(ll i=0; i<=100; i++){
        for(ll j=0; j<=100; j++){
            for(int k=0; k<n; k++){
                if(k==0){
                    tmp1 = max(abs(i - x[k]) + abs(j - y[k]) + h[k], ll(0));
                    if(h[k] == 0) break;
                } else if(k > 0 && k<= n-1){
                    tmp2 = max(abs(i - x[k]) + abs(j - y[k]) + h[k], ll(0));
                    //cout << i << " " << j << " " << tmp1 << " " << tmp2 << endl;
                    if(tmp1 != tmp2)break;
                    if(tmp1 == tmp2 && k == n-1 && tmp1 > 0){
                        cx = i;
                        cy = j;
                        cout << cx << " " << cy << " " << tmp1 << endl;   
                        return 0;
                        }
                }
            }
        }
    }

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

#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

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

    vector <int> X(no_of_points + 1);
    vector <int> Y(no_of_points + 1);
    vector <int> height(no_of_points + 1);
    for(int i = 1; i <= no_of_points; i++)
        scanf("%d %d %d", &X[i], &Y[i], &height[i]);

    if(no_of_points == 1)
    {
        printf("%d %d %d\n", X[1], Y[1], height[1]);
        return 0;
    }

    const int MAX_X = 100, MAX_Y = 100;
    long long pyramid_height; int center_x, center_y;

    for(int x = 0; x <= MAX_X; x++)
    {
        for(int y = 0; y <= MAX_Y; y++)
        {
            set <long long> candidate_heights;

            for(int i = 1; i <= no_of_points; i++)
            {
                if(height[i] == 0) continue;

                candidate_heights.insert(height[i] + abs(X[i] - x) + abs(Y[i] - y));
            }

            if(candidate_heights.size() == 1)
            {
                center_x = x, center_y = y;

                set <int> :: iterator it = candidate_heights.begin();

                pyramid_height = *it;

                if(pyramid_height == 0) pyramid_height = 1;
            }
        }
    }

    printf("%d %d %lld\n", center_x, center_y, pyramid_height);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:67: error: conversion from '_Rb_tree_const_iterator<long long int>' to non-scalar type '_Rb_tree_const_iterator<int>' requested
   45 |                 set <int> :: iterator it = candidate_heights.begin();
      |                                            ~~~~~~~~~~~~~~~~~~~~~~~^~
Language: Java

import java.util.Scanner;

public class C112miss {

	static int NUM = 2000000001;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] c = new int[101][101];

		for (int i = 0; i <= 100; i++) {
			for (int j = 0; j <= 100; j++) {
				c[i][j] = NUM;
			}
		}

		int n = sc.nextInt();

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

			if(h == 0) continue;

			inputFactor(x, y, h, c);
			// System.out.println("");

		}

		int[] ans = new int[3];

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

				if (c[i][j] > ans[2]) {
					ans[0] = i;
					ans[1] = j;
					ans[2] = c[i][j];
				}
			}
		}

		System.out.println(ans[0] + " " + ans[1] + " " + ans[2]);

		sc.close();

	}

	private static void inputFactor(int x, int y, int h, int[][] c) {

		c[x][y] = h;

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

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

				if (c[i][j] == NUM) {
					c[i][j] = tmp;
				} else {
					if (c[i][j] != tmp)
						c[i][j] = 0;
				}

				// System.out.print("["+c[i][j]+"]");

			}
			// System.out.println("");
		}

	}

}

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

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

int main()
{
	ios::sync_with_stdio(false);
	int num, time, i, j, k, rec, cx, cy, height;
	cin >> num;
	int x[num], y[num], h[num];
	for (i = 0; i < num; i++)cin >> x[i] >> y[i] >> h[i];
	for (i = 0; i < num; i++) {
		if (h[num] != 0) {
			rec = i;
			break;
		}
	}

		for (i = 0; i =< 100; i++) {
			for (j = 0; j = < 100; j++) {
				time = 0;
				height = h[rec] + abs(i - x(rec)) + abs(j - y(rec));
				for (k = 0; k < num; k++) {
					if (h[k] == max((height - abs(i - x[k]) - abs(j - y[k])), 0)) {
						time++;
					}
				}
				if (time == num) {
					cx = i;
					cy = j;
					break;
				}
			}
			if (time = num)break;
		}

		cout << cx << cy << height;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: expected primary-expression before '<' token
   19 |                 for (i = 0; i =< 100; i++) {
      |                                ^
a.cc:20:41: error: expected primary-expression before '<' token
   20 |                         for (j = 0; j = < 100; j++) {
      |                                         ^
a.cc:22:60: error: 'x' cannot be used as a function
   22 |                                 height = h[rec] + abs(i - x(rec)) + abs(j - y(rec));
      |                                                           ~^~~~~
a.cc:22:78: error: 'y' cannot be used as a function
   22 |                                 height = h[rec] + abs(i - x(rec)) + abs(j - y(rec));
      |                                                                             ~^~~~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;

int n;
int main(){
	cin>>n;
	long long x[101],y[101],h[101];
	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  height = h[0]+abs(i-x[0])+abs(j-y[0]);
//			cout<<i<<":"<<j<<":"<<height<<endl;
			int wrong=0;
			for(int k=1;k<n;k++){
				if( max(0,height  -abs(i-x[k])+abs(j-y[k]))!=h[k]){ 
					wrong=1;
					break;
				}
			}
			if(wrong){
				continue;
			}
			cout<<i<<" "<<j<<" "<<height<<endl;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: no matching function for call to 'max(int, long long int)'
   18 |                                 if( max(0,height  -abs(i-x[k])+abs(j-y[k]))!=h[k]){
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:40: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   18 |                                 if( max(0,height  -abs(i-x[k])+abs(j-y[k]))!=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