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

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

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

using namespace std;

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


int N,T;
int c[1010],t[1010];
int ans=-1;

int main(){
    scanf("%d%d",&N,&T);
    fornum(i,0,N){
        scanf("%d%d",&c[i],&t[i]);
    }
    fornum(i,0,N){
        if(t[i]<=T){
            ans=ans<c[i]?ans:c[i];
        }
    }
    if(t!=-1)
        printf("%d\n",ans);
    else
        printf("TLE\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   36 |     if(t!=-1)
      |        ~^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;



int main(){
  int n,t;
  cin >> n >> t;
  int ans = 1000;
  int aa;
  rep(i,n){
    int ca,ta;
    cin >> ca >> ta;
    if(ta<=t){
      if(ca<ans){
        ans = ca;
        aa = i;
      }
    }
  }
  if(ans!==1000){
    cout << aa+1 << endl;
  }else{
    cout << "TLE" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: expected primary-expression before '=' token
   32 |   if(ans!==1000){
      |           ^
Language: C

#include <stdio.h>


int main(void){
    //NとTの読み取り
    int N, T;
    scanf("%d %d", &N, &T);
    //cとtの読み取り
    int i;
    int c[n], t[n];
    for(i = 0 ; i < n ; i++){
        scanf("%d %d", &c[i], &t[i]);
    }
    //計算
    int c_min;
    c_min = 1001;
    for(i = 0 ; i < n ; i++){
        if(t[i] <= T){
            if(c[i] < c_min){
                c_min = c[i];
            }
        }
    }
    //表示
    printf("%d\n", c_min);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: 'n' undeclared (first use in this function)
   10 |     int c[n], t[n];
      |           ^
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;



int main(){
  int n,t;
  cin >> n >> t;
  int ans = 1000;
  int aa;
  rep(i,n){
    int ca,ta;
    cin >> ca >> ta;
    if(ta<=t){
      if(ca<ans){
        ans = ca;
        aa = i;
      }
    }
  }
  cout << (ans!=1000?aa+1:"TLE ") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: operands to '?:' have different types 'int' and 'const char*'
   32 |   cout << (ans!=1000?aa+1:"TLE ") << endl;
      |            ~~~~~~~~~^~~~~~~~~~~~
Language: C++


//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
using namespace std;
using ll=long long;

#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007


constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
 

 
int main() {
    ll N,T;
    cin >>N>>T;
    ll c[N];
    ll t[N];
    ll cost=999999;
    FOR(i,0,N-1){
        cin>>c[i]>>t[i];
    }

    FOR(i,0,N-1){
        if(t[i]=<T){
            if(cost>c[i]){cost=c[i];}
        }
    }

    if(cost==999999){
        cout<<"TLE"<<endl;
    }else{
                cout<<cost<<endl;
    }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:17: error: expected primary-expression before '<' token
   55 |         if(t[i]=<T){
      |                 ^
Language: C++

#include <iostream>
#include <cstdio>
int main()
{
    int n,m,ans=1e9,x,y;
    std::cin>>n>>m;

    for(int i=1;i<=n;i++)
    {
        std::cin>>x>>y;
        if(y>m)continue;
        ans=std::min(ans,x);
    }

    if(ans==1e9)
    {
        puts("TLE");
    }
    else std::cout<<ans<<std::endl;

}
5 9
25 8
5 9
4 10
1000 1000
6 1

Compiler output:
a.cc:22:1: error: expected unqualified-id before numeric constant
   22 | 5 9
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(void)
{
	int N,Time;
		cin >> N >> Time;
	vector <int> V;
	for(int i=0;i<N;i++){
		int a,b;
			cin >> a >> b;
		if(b<=Time)
			V.push_back(a);
	}
	if(V.empty())
		cout << "TLE" << endl;
	sort(V.begin(),V.end());
	cout << V[0] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |         sort(V.begin(),V.end());
      |         ^~~~
      |         short
Language: C++

n,T = map(int, input().split(' '))
l = []
for i in range(n):
    c,t = map(int, input().split(' '))
    if t <T+1:
        l.append(c)
if len(l)==0:
    print('TLE')
else:
    print(min(l))

Compiler output:
a.cc:8:11: warning: multi-character character constant [-Wmultichar]
    8 |     print('TLE')
      |           ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n,T = map(int, input().split(' '))
      | ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;



int main(){
  int n,t;
  cin >> n >> t;
  int c[100],t[100];
  int ans = 1000;
  int aa;
  rep(i,n){
    int ca,ta;
    cin >> ca >> ta;
    if(ta<=t){
      if(ca<ans){
        ans = ca;
        aa = i;
      }
    }
  }
  cout << (ans!==1000?aa+1:"TLE ") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: conflicting declaration 'int t [100]'
   20 |   int c[100],t[100];
      |              ^
a.cc:18:9: note: previous declaration as 'int t'
   18 |   int n,t;
      |         ^
a.cc:33:17: error: expected primary-expression before '=' token
   33 |   cout << (ans!==1000?aa+1:"TLE ") << endl;
      |                 ^
a.cc:33:22: error: operands to '?:' have different types 'int' and 'const char*'
   33 |   cout << (ans!==1000?aa+1:"TLE ") << endl;
      |                  ~~~~^~~~~~~~~~~~
Language: C++

#include<cstdio>
using namespace std;

int main(){
  int n,t,c,tt,minx=10000;
  scanf("%d %d",&n,&t);
  for(int i=0;i<n;i++){
    scanf("%d %d",&c,&tt);
    if(tt<=t&&min>c)
      minx=c;
  }
  if(min==10000)
    printf("TLE\n");
  else
    printf("%d\n",minx);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'min' was not declared in this scope; did you mean 'minx'?
    9 |     if(tt<=t&&min>c)
      |               ^~~
      |               minx
a.cc:12:6: error: 'min' was not declared in this scope; did you mean 'minx'?
   12 |   if(min==10000)
      |      ^~~
      |      minx
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
// #include <priority_queue>
#include <algorithm>

using namespace std;

int n, T, c, t;

int main() {

	cin >> n >> T;

	int ans = INT_MAX;
	for (int i = 0; i < n; ++i)
	{
		cin >> c >> t;
		if (t <= T && c < ans)
			ans = c;
	}

	if (ans == INT_MAX)
		cout << "TLE" << endl;
	else
		cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'INT_MAX' was not declared in this scope
   19 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <algorithm>
  +++ |+#include <climits>
   10 |
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> p;
const int inf=100000000;
#define rep(i,a,n)	for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=(a-1);i>=n;i--)

int main(){
	int n,t;
	cin>>n>>t;
	ll ans=inf;
	rep(i,0,n){
		int x,y;
		cin>>x,y;
		if(y<=t) min(ans,x);
	}
	if(ans==inf)cout<<"TLE"<<endl;
	else cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: no matching function for call to 'min(ll&, int&)'
   24 |                 if(y<=t) min(ans,x);
      |                          ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:24:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   24 |                 if(y<=t) min(ans,x);
      |                          ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:24:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   24 |                 if(y<=t) min(ans,x);
      |                          ~~~^~~~~~~
Language: C++

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

typedef long long ll;
typedef pair<int, int> pii;

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) (x).begin(), (x).end()

const int mod = 1e9 + 7;
const double eps = 1e-9;

int main()
{
	int n, t, res = mod;
	while (n--) {
		int a, b;
		cin >> a >> b;
		if (b <= t)
			res = min(res, a);
	}
	cout << (res == mod ? "TLE" : res);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: operands to '?:' have different types 'const char*' and 'int'
   25 |         cout << (res == mod ? "TLE" : res);
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~
Language: C++

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

const int INF = 1e9;

int main() {
  int n >> k;
  cin >> n >> k;
  
  int mn = INF;
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    if (b > k) continue;
    mn = min(mn, a);
  }
  if (mn == INF) {
    cout << "TLE" << endl;
  } else {
    cout << mn << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected initializer before '>>' token
    9 |   int n >> k;
      |         ^~
a.cc:10:10: error: 'n' was not declared in this scope
   10 |   cin >> n >> k;
      |          ^
a.cc:10:15: error: 'k' was not declared in this scope
   10 |   cin >> n >> k;
      |               ^
Language: C++

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

using namespace std;

int main() {
  int n, t;
  cin >> n >> T;
  int ans = 1e9;
  while (n--) {
    int c, t;
    cin >> c >> t;
    if (t <= T) {
      ans = min(ans, c);
    }
  }
  if (ans == 1e9) {
    cout << "TLE" << endl;
  } else {
    cout << ans << endl;
  }
}



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

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(_,v.size()){rep(__,v[_].size())cout<<" "<<v[_][__];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};//RDLU
int main(){
	int n,t;
	cin>>n>>t;
	int out=inf;
	rep(i,n){
		int a,b;
		cin>>a>>b;
		if(b<=t)out=min(out,a);
	}
	if(out==inf)cout<<"TLE"<<endl;
	else cout<<a<<endl;
	
}

/*
int n,m;
vvi nex[2],dp(2);
vi in;
void f(int a){
	int N=-1,t=m;
	while(t){
		vi dp(n,-1);
		int w=0;
		rep(i,n)if(dp[i]==-1){
			int l=i,r=i+1;
			while(r<n&&in[r]-in[r-1]<=t)r++;
			loop(j,l,r)dp[j]=r;
		}
		nex[a].pb(dp);
		t/=2;
		N++;
	}
	dp[a]=vi(1<<N,-1);
	dp[a][0]=0;
	rep(i,1<<N)if(dp[a][i]-n)rep(j,N)if((i&1<<j)==0)cmax(dp[a][i|1<<j],nex[a][j+1][dp[a][i]]);
}
int main(){
	cin>>n>>m;
	in=vi(n);
	rep(i,n)cin>>in[i];
	
	f(0);
	rep(i,n)in[i]*=-1;
	sort(all(in));
	f(1);
	
	rep(i,n){
		int l=n-nex[1][0][i]-1,r=nex[0][0][i];
		bool h=false;
		
	}
	
}
*/








Compiler output:
a.cc: In function 'int main()':
a.cc:66:20: error: 'a' was not declared in this scope
   66 |         else cout<<a<<endl;
      |                    ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
struct cordinate
{
	long long x;
	long long y;
	long long h;
};

int main()
{
	long long N;
	int flag = 0;
	cin >> N;
	cordinate* ip;
	ip = new cordinate[N];
	for (int i = 0;i < N;i++)
	{
		cin >> ip[i].x >> ip[i].y >> ip[i].h;
	}
	long long a = ip[0].x, b = ip[0].y;
	long long c = ip[0].h;
	long long i, j, k;

	for (i = 0;i <= 100;i++)
	{
		for (j = 0; j <= 100;j++)
		{
			flag = 1;
			for (k = 1;k < N;k++)
			{
				if (long long(abs(i - ip[k].x) + abs(j - ip[k].y) - (abs(i - a) + abs(j - b))) != c - ip[k].h)
				{
					flag = 0;break;
				}
			}
			if (flag == 1) break;
		}
		if (flag == 1) break;
	}
	cout << i << ' ' << j << ' ' << abs(i - a) + abs(j - b) + c;
	delete[]ip;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:37: error: expected primary-expression before 'long'
   33 |                                 if (long long(abs(i - ip[k].x) + abs(j - ip[k].y) - (abs(i - a) + abs(j - b))) != c - ip[k].h)
      |                                     ^~~~
a.cc:33:37: error: expected ')' before 'long'
   33 |                                 if (long long(abs(i - ip[k].x) + abs(j - ip[k].y) - (abs(i - a) + abs(j - b))) != c - ip[k].h)
      |                                    ~^~~~
      |                                     )
Language: C

#include <bits/stdc++.h>
#define int long long 
#define re register int 
#define il inline
#define ll long long
using namespace std;
const int inf=1e9;
il int read(){
	char c=getchar();int z=0,f=1;
	while(c!='-'&&(c>'9'||c<'0')) c=getchar();
	if(c=='-') f=-1,c=getchar();
	while(c>='0'&&c<='9') z=(z<<1)+(z<<3)+c-'0',c=getchar();
	return z*f;
}
const int N=1e5+10;
const int mod=1e9+7;
int n,A,B;
int f[N],sum[N],a[N];
signed main (){
	n=read();A=read();B=read();
	if(A<B) swap(A,B);
	for(re i=1;i<=n;i++) a[i]=read();
	for(re i=1;i+2<=n;i++) 
		if(a[i+2]-a[i]<B){cout<<0;return 0;}
	f[0]=sum[0]=1;
	for(re i=1,p=0,q=0;i<=n;i++){
		while(q<i&&a[i]-a[q+1]>=A) ++q;
		if(p<=q)f[i]=(f[i]+sum[q]-(p?sum[p-1]:0)+mod)%mod;
		sum[i]=(sum[i-1]+f[i])%mod;
		if(i>1&&a[i]-a[i-1]<B) p=i-1;
	}
	int ans=0;
	for(re i=n;i>=0;i--){
		ans=(ans+f[i])%mod;
		if(i<n&&a[i+1]-a[i]<B) break;
	}
	cout<<ans;
	return 0;
} 

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

```cpp
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int n,F,x[101],y[101],h[101];
inline bool check(int X,int Y,int H)
{
	for(register int i=1;i<=n;i++)
		if((((H-abs(X-x[i])-abs(Y-y[i]))<0)?0:H-abs(X-x[i])-abs(Y-y[i]))!=h[i])
			return false;
	return true;
}
int main() 
{
	scanf("%d",&n);
	for(register int i=1; i<=n; i++) {
		scanf("%d%d%d",&x[i],&y[i],&h[i]);
		if(h[i]!=0)F=i;
	}
	for(int i=0;i<=100;i++) 
	{
		for(int j=0;j<=100;j++) 
		{
			if(check(i,j,abs(i-x[F])+abs(j-y[F])+h[F]))
			{
				cout<<i<<" "<<j<<" "<<(int)abs(i-x[F])+abs(j-y[F])+h[F]<<endl;
				return 0;
			}
		}
	}
	return 0;
}
```

Compiler output:
main.c:1:1: error: stray '`' in program
    1 | ```cpp
      | ^
main.c:1:2: error: stray '`' in program
    1 | ```cpp
      |  ^
main.c:1:3: error: stray '`' in program
    1 | ```cpp
      |   ^
main.c:2:9: fatal error: cstdio: No such file or directory
    2 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N; //データの数
  
  /////データ格納用の箱を用意/////
  int x[101];
  int y[101];
  long h[101];
  long H=-1,Z=0;
  int X=-1,Y=-1;
  
  
  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++){
      H=abs(x[0]-i)+abs(y[0]-j)+h[0];
      for(int k=1;k<N;k++){
        long cur=0;
        cur=abs(x[k]-i)+abs(y[k]-j)+h[k];
        cur=max(cur,0);
        
        if(H !=cur)break;
        if(k==N-1){
          X=i;
          Y=j;
          Z=H;
        }
      }
    }
  }
  
  cout<<X<<" "<<Y<<" "<<Z<<endl;
}
    
  
      
      	  
        
        
  
  
    
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: no matching function for call to 'max(long int&, int)'
   24 |         cur=max(cur,0);
      |             ~~~^~~~~~~
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:24:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   24 |         cur=max(cur,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
Language: C++

#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef long double ld;
#define fr first
#define sc second
#define pb push_back
const ll mod = 998244353;
const int N = 1e6+205;
ll pt[N][3];
ll fnd[N][2];
void solve(){
	int n; 
	cin>>n;
	ll h = 0;
	for(int i=1;i<=n;i++){
		for(int j=0;j<3;j++)cin>>pt[i][j];
	}
	if(n==1){
		cout<<pt[i][0]<<" "<<pt[i][1]<<" "<<pt[i][2]<<endl;
		return ;
	}
	for(int x = 0;x<=100;x++){
		for(int y=0;y<=100;y++){
			map<int,int>mp;
			int trt = 0;
			for(int i=1;i<=n;i++){
				if(pt[i][2]==0)continue;
				int dis = abs(x-pt[i][0])+abs(y-pt[i][1]);
				trt++;
				mp[dis+pt[i][2]]++;
			}
			for(auto p:mp){
				if(p.sc==trt){
					if(h>0 and h!=p.fr){
						cout<<"WTF"<<endl;
						return ;
					}
					if(h==0)h = p.fr;
				}
			}
		}
	}
	for(int x = 0;x<=100;x++){
		for(int y=0;y<=100;y++){
			int trt = 0;
			int trrt = 0;
			for(int i=1;i<=n;i++){
				if(pt[i][2]==0)continue;
				trrt++;
				int dis = abs(x-pt[i][0])+abs(y-pt[i][1]);
				if(dis+pt[i][2]==h)trt++;
			}
			if(trt==trrt){
				cout<<x<<" "<<y<<" "<<h<<endl;
				return ;
			}
			
		}
	}
	assert(0);
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1; 
//	cin>>t; 
	while(t--){
		solve();
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:26: error: 'i' was not declared in this scope
   20 |                 cout<<pt[i][0]<<" "<<pt[i][1]<<" "<<pt[i][2]<<endl;
      |                          ^
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
using namespace std;
using ll = long long;

int main(){
  int N;
  cin >> N;
  vector<ll> X(N),Y(N),H(N);
  for(int i=0;i<N;i++){
    cin >> X[i] >> Y[i] >> H[i];
  }
  bool flag=true;
  for(int i=0;i<=100;i++){
    for(int j=0;j<=100;j++){
      for(int k=0;k<N;k++){
        if(H[k]!=0){
          ll height=H[0]+abs(i-X[0])+abs(j-Y[0]);
          break;
        }
      }
      flag=true;
      for(int k=0;k<N;k++){
        if(height-abs(X[k]-i)-abs(Y[k]-j)!=H[k]){
          flag=false;
          break;
        }
      }
      if(flag){
        cout << i << " " << j << " " << height << endl;
        return 0;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:12: error: 'height' was not declared in this scope
   41 |         if(height-abs(X[k]-i)-abs(Y[k]-j)!=H[k]){
      |            ^~~~~~
a.cc:47:41: error: 'height' was not declared in this scope
   47 |         cout << i << " " << j << " " << height << endl;
      |                                         ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define rep(i,s,e) for (int64_t i=s; i<e; i++)
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int N, S, T, U, H;
  cin >> N;
  long int O=0;
  vector<int> x(N);
  vector<int> y(N);
  vector<int> h(N);
  rep(i,0,N) {
    cin >> x[i] >> y[i] >> h[i];
  }
  rep(i,0,N) {
    if (h[i]>0) {
      S=x[i];
      T=y[i];
      U=h[i];
      break;
    }
  }
  rep(X,0,101) {
    rep(Y,0,101) {
      H=U+abs(X-S)+abs(Y-T);
      rep(i,0,N) {
        int K=0;
        if (h[i]==max((H-abs(x[i]-X)-abs(y[i]-Y)),O)) {
          K++;
        }
      }
      if (K==N) {
        cout << X << " " << Y << " " << H << endl;
      }
    }
  }
}

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

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

int main(){
int n;
  cin >> n;
vector<vector<int>> d(n,vector<int>(3));
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
     cin >> d[i][j];
    }
  }
int H=-1;
int h,s,t;  
  for(int i=0;i<=100;i++){
   for(int j=0;j<=100;j++){
     for(int k=0;k<n;k++){
    h=1000-abs(d[k][1]-i)-abs(d[k][1]-j);
    if(h>H) {
    H=h;
    s=i;
    t=j;  
    }
   }
  }
  int HH=d[0][2]+abs(d[0][0]-s)+abs(d[0][1]-t);
  cout << s << " " << t << " " << HH << endl;
}

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

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

int main(){
int n;
  cin >> n;
vector<vector<int>> d(n,vector<int>(3));
  for(int i=0;i<n;i++){
    for(int j=0;j<3;j++){
     cin >> d[i][j];
    }
  }
int H=-1;
int h,s,t;  
  for(int i=0;i<=100;i++){
   for(int j=0;j<=100;j++){
     for(int k=0;k<n;k++){
    h=1000-abs(d[k][1]-i)-abs(d[k][1]-j);
    if(h>H) {
    H=h;
    s=i;
    t=j;  
    }
   }
  }
  int HH=d[0][2]+abs(d[0][0]-s)+abs(d[0][1]-t);
  cout << s << " " << t << " " << HH << endl;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdv++.h: No such file or directory
    1 | #include <bits/stdv++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define P pair<ll,ll>
#define int ll

int main(){
  int n;
  cin>>n;
  int Cx,Cy,H;
  vector<int> x(n),y(n),h(n);
  rep(i,n) cin>>x[i]>>y[i]>>h[i];
  bool flag=0;
  for(int i=0; i<=100; i++){
    for(int j=0; j<=100; j++){
      bool ok=1;
      H=0;
      rep(p,n){
        if(H!=0 && H!=h[p]+abs(i-x[p])+abs(j-y[p])) ok=0;
        H=h[p]+abs(i-x[p])+abs(j-y[p]);
      }
      if(ok){
        flag=1; Cx=i; Cy=j; break; 
      }
    }
    if(flag)break;
  }
  cout<<Cx<<" "<<Cy<<" "<<H<<endl;
}


Compiler output:
a.cc:6:13: error: '::main' must return 'int'
    6 | #define int ll
      |             ^~
a.cc:8:1: note: in expansion of macro 'int'
    8 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

ll gcd(ll a, ll b) {return (!b ? a : gcd(b, a % b));}
ll lcm(ll a, ll b) {return ((a*b)/gcd(a,b));}
bool cmp(int a,int b){return a>b;}

const ll mod = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;
const int N = 1e6 + 10;

long long modpow(long long n, long long k, long long mod)
{
if (k == 0) return 1;
long long r = modpow(n * n % mod, k >> 1, mod);
if (k & 1) r = r * n % mod;
return r;
}

void solve(){
  int n;cin >> n;
  vector<int>x(n),y(n),h(n);
  for(int i = 0;i<n;i++){
    cin >> x[i] >> y[i] >> h[i];
  }
  for(int nx = 0;nx<=100;nx++){
    for(int ny = 0;ny<=100;ny++){
    bool ok = 1;int now = 0;int lim = 2e9;
        for(int i = 0;i<n;i++){
            int a = abs(x[i]-nx)+abs(y[i]-ny);
            int dh = h[i]+a;
            if(i==0){
                if(h[i]) now = dh;
                else lim = dh;
                continue;
            }
            if(h[i]==0){
                if(dh<=lim) lim = dh;
                else ok = 0;
                continue;
            }
            if(now == 0){
                if(dh<=lim) now = dh;
                else ok = 0;
                continue;
            }
            else{
                if(dh!=now) ok = 0;
            }
        }
        if(ok){
            cout << nx <<' '<< ny <<' '<< now;
            return;
        }
    }
  }
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long LL;
typedef vector<ll>VI;
typedef pair<ll,ll>P;
typedef pair<double,double>P_D;
#define VV(T) vector<vector<T>>
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define ALL(a)  (a).begin(),(a).end()
#define c_max(a, b) (((ll)a)>((ll)b)?(a):(b))
#define c_min(a,b) (((ll)a)<((ll)b)?(a):(b))
#define chmax(x,a) x=max(x,a)
#define chmin(x,a) x=min(x,a)
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define $(x) {cout<<#x<<" = " <<(x)<<endl;}
#define fi first
#define se second
#define MAX 100100//5
#define MAX2 200100
#define MAX_6 1001001//6
#define MAX_7 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
const int MOD = 1000000007;
#define INF 1<<30
#define INFTY 1LL<<61
#define MAX_INT INT_MAX
#define Endl '\n'
inline ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
inline ll lcm(ll a,ll b){return a*b/GCD(a,b);}
using Edge=pair<int,ll>;
using Graph=vector<vector<int> >;//ll or Edge
using Edge=pair<int,ll>;
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
// sort_reverse...greater<ll>()
// vector型から重複を削除 list.erase(unique(ALL(list)),list.end());
// g++ -o a a.cpp -Wall -lm -std=c++17

int main(){
    int n;cin>>n;
    VI x(n),y(n),h(n);
    int si=-1;
    rep(i,n){
        cin>>x[i]>>y[i]>>h[i];
        if(h[i]>0)si=i;
        }
    ll resx=-1,resy=-1,resH=-1;
    rep(X,100+1)rep(Y,100+1){
        ll H=h[si]+abs(X-x[si])+abs(Y-y[si]);
        ll limit=INFTY;
        bool ok=true;
        rep(i,n){
            if(h[i]){
                ll tH=h[i]+abs(X-x[i])+abs(Y-y[i]);
                if(h[i]>0 && )
            }
            else {
                limit=abs(X-x[i])+abs(Y-y[i]);
            }
        }
        if(H>=1 && H<=limit){
            resx=X,resy=Y,resH=H;
        }
    }
     cout<<resx<<" "<<resy<<" "<<resH<<endl;
            return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:30: error: expected primary-expression before ')' token
   59 |                 if(h[i]>0 && )
      |                              ^
a.cc:60:13: error: expected primary-expression before '}' token
   60 |             }
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<ll, ll> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
	int n;
	cin >> n;
	vector<ll> x(n), y(n);
	vector<ll> h(n);
	rep(i,n) cin >> x[i] >> y[i] >> h[i];
	vector<pair<ll, pii>> v(n);
	rep(i,n) {
		if (h[i] == 0) continue;
		v[i].first = h[i];
		v[i].second.first = x[i];
		v[i].second.second = y[i];
	}
	for (ll i = 0; i <= 100; i++) {
		for (ll j = 0; j <= 100; j++) {
			ll mh = v[0].first + abs(v[0].second.first - j) + abs(v[0].second.second - i);
			bool b = true;
			for (int k = 0; k < n; k++) {
				ll k = mh - abs(v[k].second.first - j) - abs(v[k].second.second - i);
				k = max(k, 0ll);
				if (v[k].first != k) b = false;
			}
			if (b) {
				cout << j << " " << i << " " << mh << endl;
				return;
			}
		}
	}
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:36: error: redeclaration of 'll k'
   31 |                                 ll k = mh - abs(v[k].second.first - j) - abs(v[k].second.second - i);
      |                                    ^
a.cc:30:34: note: 'int k' previously declared here
   30 |                         for (int k = 0; k < n; k++) {
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,x[101],y[101],h[101];
    cin>>n;
    rep(i,n) cin>>x[i]>>y[i]>>h[i];
    rep(i,101)rep(j,101){
        ll z=1,H;
        rep(k,n){
            if(h[k]!=0) H=h[k]+abs(i-x[k])+abs(j-y[k]);
        }
        rep(k,n){
            if(h[k]==0){
                if(abs(i-x[k])+abs(j-y[k])>H) z=0;
            }
            else(h[k]+abs(i-x[k])+abs(j-y[k])!=H) z=0;
        }
        if(z){
            cout<<i<<" "<<j<<" "<<h[0]+abs(i-x[0])+abs(j-y[0]);
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:50: error: expected ';' before 'z'
   27 |             else(h[k]+abs(i-x[k])+abs(j-y[k])!=H) z=0;
      |                                                  ^~
      |                                                  ;
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define INIT    \
    cin.tie(0); \
    ios::sync_with_stdio(false);

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

ll const INF = 1LL << 60;
ll const MOD = 1000000007;

int main() {
    INIT;

    ll N;
    cin >> N;
    vector<ll> x(N), y(N), h(N);
    ll start = -1;
    rep(i, N) {
        cin >> x[i] >> y[i] >> h[i];
        if (h[i] > 0) start = i
    }

    ll X, Y, H;
    rep(i, 101) {
        rep(j, 101) {
            ll tmph = h[start] + abs(i - h[start]) + abs(j - h[start]);
            bool flg = true;

            rep(n, N) {
                if (h[n] > 0 && tmph != h[n] + abs(i - x[n]) + abs(j - y[n]))
                    flg = false;
                if (h[n] == 0 && tmph > abs(i - x[n]) + abs(j - y[n]))
                    flg = false;
            }

            if (flg) {
                X = i;
                Y = j;
                H = tmph;
            }
        }
    }

    cout << X << " " << Y << " " << H << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:32: error: expected ';' before '}' token
   51 |         if (h[i] > 0) start = i
      |                                ^
      |                                ;
   52 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,i,j,k,x,H;
    cin>>n;
    long long int X[n],Y[n],h[n];
    int indx=0;
    for(i=0; i<n; i++)
    {
        cin>>X[i]>>Y[i]>>h[i];
        if(h[i] > 0)
        {
            indx= i;
        }
    }

    for(i=0; i<=100; i++)
    {
        for(j=0; j<=100; j++)
        {
            H=h[indx]+abs(X[indx]-i)+abs(Y[indx]-j);
            bool its_ok=true;
            for(k=0; k<n; k++)
            {
                if(max(H-abs(X[k]-i)-abs(Y[k]-j),0)!=h[k])
                {
                    its_ok=false;
                    break;
                }
            }
            if(its_ok)
            {
                cout<<i<<' '<<j<<' '<<H<<endl;
                return 0;
            }
        }
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: no matching function for call to 'max(long long int, int)'
   26 |                 if(max(H-abs(X[k]-i)-abs(Y[k]-j),0)!=h[k])
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:26:23: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   26 |                 if(max(H-abs(X[k]-i)-abs(Y[k]-j),0)!=h[k])
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:26:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   26 |                 if(max(H-abs(X[k]-i)-abs(Y[k]-j),0)!=h[k])
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    int n;
    cin >> n;
    vector<int> x(n), y(n), h(n);
    rep(i,n) cin >> x[i] >> y[i] >> h[i];
    rep(cx, 101) rep(cy, 101){
        bool ok = true;
        int pre = h[0] + abs(cx-x[0]) + abs(cy-y[0]);
        for(int i = 1, i < n; i++){
            if (h[i] == 0) continue;
            int H = h[i] + abs(cx-x[i]) + abs(cy-y[i]);
            if (pre != H){
                ok = false;
                break;
            }
            pre = H;
        }
        if (ok) {
            printf("%d %d %d\n", cx, cy, pre);
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: expected ';' before '<' token
   24 |         for(int i = 1, i < n; i++){
      |                         ^~
      |                         ;
a.cc:24:26: error: expected primary-expression before '<' token
   24 |         for(int i = 1, i < n; i++){
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    int n;
    cin >> n;
    vector<int> x(n), y(n), h(n);
    rep(i,n) cin >> x[i] >> y[i] >> h[i];
    rep(cx, 101) rep(cy, 101){
        bool ok = true;
        int pre = h[i] + abs(cx-x[0]) + abs(cy-y[0]);
        for(int i = 1, i < n; i++){
            if (h[i] == 0) continue;
            int H = h[i] + abs(cx-x[i]) + abs(cy-y[i]);
            if (pre != H){
                ok = false;
                break;
            }
            pre = H;
        }
        if (ok) {
            printf("%d %d %d\n", cx, cy, pre);
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: 'i' was not declared in this scope
   23 |         int pre = h[i] + abs(cx-x[0]) + abs(cy-y[0]);
      |                     ^
a.cc:24:25: error: expected ';' before '<' token
   24 |         for(int i = 1, i < n; i++){
      |                         ^~
      |                         ;
a.cc:24:26: error: expected primary-expression before '<' token
   24 |         for(int i = 1, i < n; i++){
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n;
cin>>n;
ll x[n]={},y[n]={},h[n]={};
ll ha=0;
ll b=0;
ll e=-1;
for(ll i=0; i<n; i++){
cin>>x[i]>>y[i]>>h[i];}
for(ll i=0; i<n; i++){
if(h[i]!=0){
e=i;
break;}}
for(ll i=0; i<=100; i++){
for(ll k=0; k<=100; k++){
ha=abs(i-x[e])+abs(k-y[e])+h[e];
for(ll q=0; q<n; q++){
if(q==e) continue;
if(!(ha-abs(i-x[q])-abs(k-y[q])==h[q]||(ha-abs(i-x[q])-abs(k-y[q])<=0&&h[q]==0))){
b++;	
break;}}
if(b==0){
cout<<i<<" "<<k<<" "<<ha;
goto end;}
b=0;}}
end:
cout<<endl;}}


Compiler output:
a.cc:45:13: error: expected declaration before '}' token
   45 | cout<<endl;}}
      |             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<ll, ll>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;

int main(){
    #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<ll, ll>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;
 
int main(){
    int n; cin >> n;
    vector<T> pi(n);
    rep(i,n){
        int x,y,h; cin >> x >> y >> h;
        pi[i]=T(x,y,h);
    }
 
    int nowx,nowy,height;
 
    queue<T> q;
 
    rep(i,n){
        tie(nowx,nowy,height)=pi[i];
        if(height==0) continue;
        break;
    }
 
    rep(i,101){
        rep(j,101){
            int nowh=abs(nowx-i)+abs(nowy-j)+height;
            q.push(T(i,j,nowh));
        }
    }
    int l=q.size();
        while(l--){
            int a,b,c;
            tie(a,b,c)=q.front();
            q.pop();
            rep(i,n){
                tie(nowx,nowy,height)=pi[i];
                if(height==0){
                   if(i==n-1){
                    cout << a << ' ' << b << ' ' << c << endl;
                    return 0;
                    }
                else continue;
                }
                else{
                int nowh=abs(nowx-a)+abs(nowy-b)+height;
                if(nowh!=c) break;
                }
                if(i==n-1){
                    cout << a << ' ' << b << ' ' << c << endl;
                    return 0;
                }
            }
        }
 
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   26 | int main(){
      |         ^~
a.cc:26:9: note: remove parentheses to default-initialize a variable
   26 | int main(){
      |         ^~
      |         --
a.cc:26:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:26:11: error: a function-definition is not allowed here before '{' token
   26 | int main(){
      |           ^
a.cc:76:2: error: expected '}' at end of input
   76 | }
      |  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<ll, ll>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;

int main(){
    #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<ll, ll>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;
 
int main(){
    int n; cin >> n;
    vector<T> pi(n);
    rep(i,n){
        int x,y,h; cin >> x >> y >> h;
        pi[i]=T(x,y,h);
    }
 
    int nowx,nowy,height;
 
    queue<T> q;
 
    rep(i,n){
        tie(nowx,nowy,height)=pi[i];
        if(height==0) continue;
        break;
    }
 
    rep(i,101){
        rep(j,101){
            int nowh=abs(nowx-i)+abs(nowy-j)+height;
            q.push(T(i,j,nowh));
        }
    }
    int l=q.size();
        while(l--){
            int a,b,c;
            tie(a,b,c)=q.front();
            q.pop();
            rep(i,n){
                tie(nowx,nowy,height)=pi[i];
                if(height==0){
                   if(i==n-1){
                    cout << a << ' ' << b << ' ' << c << endl;
                    return 0;
                    }
                    else continue;
                }
                else{
                int nowh=abs(nowx-a)+abs(nowy-b)+height;
                if(nowh!=c) break;
                }
                if(i==n-1){
                    cout << a << ' ' << b << ' ' << c << endl;
                    return 0;
                }
            }
        }
 
return 0;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   26 | int main(){
      |         ^~
a.cc:26:9: note: remove parentheses to default-initialize a variable
   26 | int main(){
      |         ^~
      |         --
a.cc:26:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:26:11: error: a function-definition is not allowed here before '{' token
   26 | int main(){
      |           ^