Language: C++

#include<bits/stdc++.h>

#define LL long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back

using namespace std;

LL gcd(LL a,LL b){return b?gcd(b,a%b):a;}
LL lcm(LL a,LL b){return a/gcd(a,b)*b;}
LL powmod(LL a,LL b,LL MOD){LL ans=1;while(b){if(b%2)ans=ans*a%MOD;a=a*a%MOD;b/=2;}return ans;}
const int N = 2e5 +11;
int n;
struct uzi
{
	LL a,b,h;
}p[N];
LL ans;
LL c(int x,int y){
	int sta=1;
	LL H =0ll+abs(p[1].a-x)+abs(p[1].b-y)+p[1].h;
	for(int i=2;i<=n;i++){
		if(max(H-abs(x-p[i].a)-abs(y-p[i].b),0ll)!=p[i].h){
			sta=0;
			break;
		}
	}
	if(sta)return ans=H,1;
	return 0;
}
map<pair<int,pair<int,int> > ,int>pos;
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n;i++)cin>>p[i].a>>p[i].b>>p[i].h,pos[{p[i].a,{p[i].b,p[i].h}}]=1;
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++){
			if(c(i,j)){
				if(!pos[{i,j,ans}])
				return cout<<i<<' '<<j<<' '<<ans<<endl,0;
			}

		}
	}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:68: warning: narrowing conversion of 'p[i].uzi::a' from 'long long int' to 'int' [-Wnarrowing]
   37 |         for(int i=1;i<=n;i++)cin>>p[i].a>>p[i].b>>p[i].h,pos[{p[i].a,{p[i].b,p[i].h}}]=1;
      |                                                               ~~~~~^
a.cc:41:40: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, std::pair<int, int> >, int>' and '<brace-enclosed initializer list>')
   41 |                                 if(!pos[{i,j,ans}])
      |                                        ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, std::pair<int, int> >; _Tp = int; _Compare = std::less<std::pair<int, std::pair<int, int> > >; _Alloc = std::allocator<std::pair<const std::pair<int, std::pair<int, int> >, int> >; mapped_type = int; key_type = std::pair<int, std::pair<int, int> >]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::map<std::pair<int, std::pair<int, int> >, int>::key_type&' {aka 'const std::pair<int, std::pair<int, int> >&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<int, std::pair<int, int> >; _Tp = int; _Compare = std::less<std::pair<int, std::pair<int, int> > >; _Alloc = std::allocator<std::pair<const std::pair<int, std::pair<int, int> >, int> >; mapped_type = int; key_type = std::pair<int, std::pair<int, int> >]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<int, std::pair<int, int> >, int>::key_type&&' {aka 'std::pair<int, std::pair<int, int> >&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~