Language: C++

#include <stdio.h>
#include <vector>

class Point {
public:
    int x, y;
    Point(int a, int b);
    Point();
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

Point::Point(int a = 0, int b = 0) : x(a), y(b)
{
}
#if 0
Point::Point()
{
    int x = 0;
    int y = 0;
}
#endif
void convex_hull(const std::vector<Point>& P)
{
    int k = 2;
    int n = P.size();
    std::vector<Point> H;
    H.resize(2 * n);
    H[0] = P[0];
    //H.push_back(P[0]);
    H[1] = P[1];
    //H.push_back(P[1]);
    int i;
    for (i = 0; i < n - 2; i++) {
        while (k >= 2 && (H[k - 1].x - H[k - 2].x) * (P[i + 2].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i + 2].x - H[k - 2].x) < 0) {
            k--;
            //H.pop_back();
            //k--;
        }
        H[k++] = P[i + 2];
        //H.push_back(P[i + 2]);
        //k++;
    }
    H[k++] = P[n - 2];
    // H.push_back(P[n - 2]);
    for (i = n; i > 2; i--) {
        while (k >= 2 && (H[k - 1].x - H[k - 2].x) * (P[i - 3].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i - 3].x - H[k - 2].x) < 0) {
            //H.pop_back();
            k--;
        }
        //H.push_back(P[i - 3]);
        H[k++] = P[i - 3];
        //k++;
    }
    H.resize(k - 1);
    printf("%d\n", H.size());
    for (i = 0; i < (int)H.size(); i++) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
}

int main() {
    int n;
    scanf("%d", &n);
    std::vector<Point> P(n);
    int i;
    for (i = 0; i < n; i++) {
        Point point;
        scanf("%d %d",&point.x, &point.y);
        P[i] = point;
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    convex_hull(P);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:15: error: call of overloaded 'Point()' is ambiguous
   69 |         Point point;
      |               ^~~~~
a.cc:8:5: note: candidate: 'Point::Point()'
    8 |     Point();
      |     ^~~~~
a.cc:14:1: note: candidate: 'Point::Point(int, int)'
   14 | Point::Point(int a = 0, int b = 0) : x(a), y(b)
      | ^~~~~
In file included from /usr/include/c++/14/vector:64,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_construct.h: In instantiation of 'void std::_Construct(_Tp*, _Args&& ...) [with _Tp = Point; _Args = {}]':
/usr/include/c++/14/bits/stl_uninitialized.h:643:18:   required from 'static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Point*; _Size = long unsigned int; bool _TrivialValueType = false]'
  643 |                 std::_Construct(std::__addressof(*__cur));
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_uninitialized.h:712:20:   required from '_ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Point*; _Size = long unsigned int]'
  710 |       return __uninitialized_default_n_1<__is_trivial(_ValueType)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711 |                                          && __can_fill>::
      |                                          ~~~~~~~~~~~~~~~~
  712 |         __uninit_default_n(__first, __n);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_uninitialized.h:779:44:   required from '_ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = Point*; _Size = long unsigned int; _Tp = Point]'
  779 |     { return std::__uninitialized_default_n(__first, __n); }
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:821:35:   required from 'void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = Point; _Alloc = std::allocator<Point>; size_type = long unsigned int]'
  821 |                 std::__uninitialized_default_n_a(this->_M_impl._M_finish,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
  822 |                                                  __n, _M_get_Tp_allocator());
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1016:4:   required from 'void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = Point; _Alloc = std::allocator<Point>; size_type = long unsigned int]'
 1016 |           _M_default_append(__new_size - size());
      |           ^~~~~~~~~~~~~~~~~
a.cc:29:13:   required from here
   29 |     H.resize(2 * n);
      |     ~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_construct.h:119:7: error: call of overloaded 'Point()' is ambiguous
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:5: note: candidate: 'Point::Point()'
    8 |     Point();
      |     ^~~~~
a.cc:14:1: note: candidate: 'Point::Point(int, int)'
   14 | Point::Point(int a = 0, int b = 0) : x(a), y(b)
      | ^~~~~