Language: C++

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

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

    std::vector<std::tuple<int, int, int>> data;
    int x, y, h;
    for (int i = 0; i < N; i++) {
        std::cin >> x >> y >> h;
        data.insert(std::make_tuple(h, x, y));
    }

    std::sort(std::begin(data), std::end(data), std::greater<int, int, int>());

    int CX = 0;
    int CY = 0;
    int H = 0;

    bool find = false;
    for (int x = 0; x <= 100; x++) {
        for (int y = 0; y <= 100; y++) {
            for (int h = 0; h <= 200; h++) {
                int cx = x;
                int cy = y;
                int ch = std::get<0>(data[0]) + h;
                
                // すべての観測点で矛盾が生じなければＯＫ
                bool check = true;
                for (int i = 0; i < N; i++) {
                    int ch = std::abs(cx - std::get<1>(data[i])) +  
                                std::abs(cy - std::get<2>(data[i])) + 
                                std::get<0>(data[i]); 
                    if (ch != H) {
                        check = false;
                        break;
                    }
                }

                if (check) {
                    CX = cx;
                    CY = cy;
                    H = ch;
                    find = true;
                    break;
                }
            }

            if (find) break;
        }
        if (find) break;
    }

    if (find) {
        std::cout << CX << " " << CY << " " << H << std::endl;
    }
 

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: no matching function for call to 'std::vector<std::tuple<int, int, int> >::insert(std::tuple<int, int, int>)'
   15 |         data.insert(std::make_tuple(h, x, y));
      |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1484:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >]'
 1484 |         insert(const_iterator __position, _InputIterator __first,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1484:9: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/vector:72:
/usr/include/c++/14/bits/vector.tcc:133:5: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, const value_type&) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; iterator = std::vector<std::tuple<int, int, int> >::iterator; const_iterator = std::vector<std::tuple<int, int, int> >::const_iterator; value_type = std::tuple<int, int, int>]'
  133 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:133:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1395:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, value_type&&) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; iterator = std::vector<std::tuple<int, int, int> >::iterator; const_iterator = std::vector<std::tuple<int, int, int> >::const_iterator; value_type = std::tuple<int, int, int>]'
 1395 |       insert(const_iterator __position, value_type&& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1395:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1413:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; iterator = std::vector<std::tuple<int, int, int> >::iterator; const_iterator = std::vector<std::tuple<int, int, int> >::const_iterator]'
 1413 |       insert(const_iterator __position, initializer_list<value_type> __l)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1413:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1439:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, size_type, const value_type&) [with _Tp = std::tuple<int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int> >; iterator = std::vector<std::tuple<int, int, int> >::iterator; const_iterator = std::vector<std::tuple<int, int, int> >::const_iterator; size_type = long unsigned int; value_type = std::tuple<int, int, int>]'
 1439 |       insert(const_iterator __position, size_type __n, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1439:7: note:   candidate expects 3 arguments, 1 provided
a.cc:18:75: error: wrong number of template arguments (3, should be at least 0)
   18 |     std::sort(std::begin(data), std::end(data), std::greater<int, int, int>());
      |                                                                           ^
In file included from /usr/include/c++/14/string:49,
                 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_function.h:353:12: note: provided for 'template<class _Tp> struct std::greater'
  353 |     struct greater;
      |            ^~~~~~~