Language: C++

#include <bits/stdc++.h>

#define fr first
#define sc second
#define mk make_pair

using namespace std;

int n, m;
pair< pair<int, int>, int> ar[1000001];
vector<pair< pair<int, int>, int> > vec, aa, bb;
long double ans[1000001];

bool cw(pair<int, int> a, pair<int, int> b, pair<int, int> c)
{
    return (a.fr * (b.sc - c.sc) + b.fr * (c.sc - a.sc) + c.fr * (a.sc - sc)) > 0;
}
bool cww(pair<int, int> a, pair<int, int> b, pair<int, int> c)
{
    return (a.fr * (b.sc - c.sc) + b.fr * (c.sc - a.sc) + c.fr * (a.sc - sc)) < 0;
}

void f()
{
    pair< pair<int, int>, int> a, b;
    sort(ar + 1, ar + n + 1);
    for(int i = 1; i <= n; i++)
    {
        if(!cww(ar[1], ar[i], ar[n]))
        {
            while(aa.size() >= 2 && cww(aa[aa.size() - 1], aa[aa.size() - 2], ar[i]))
                aa.pop_back();
            aa.push_back(ar[i]);
        }
    }

    bb = aa;
    aa.clear();

    sort(ar + 1, ar + n + 1, greater<pair<pair<int, int>, int> > ());
    for(int i = 1; i <= n; i++)
    {
        if(!cw(ar[1], ar[i], ar[n]))
        {
            while(aa.size() >= 2 && cw(aa[aa.size() - 1], aa[aa.size() - 2], ar[i]))
                aa.pop_back();
            aa.push_back(ar[i]);
        }
    }
    swap(aa, bb);
    aa.pop_back();
    for(int i = 0; i < aa.size(); i++)
        vec.push_back(aa[i]);
    for(int i = 0; i < bb.size(); i++)
        vec.push_back(bb[i]);
}

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> ar[i].fr.fr >> ar[i].fr.sc, ar[i].sc = i;

    f();
    return 0;
}


Compiler output:
a.cc: In function 'bool cw(std::pair<int, int>, std::pair<int, int>, std::pair<int, int>)':
a.cc:4:12: error: 'second' was not declared in this scope
    4 | #define sc second
      |            ^~~~~~
a.cc:16:74: note: in expansion of macro 'sc'
   16 |     return (a.fr * (b.sc - c.sc) + b.fr * (c.sc - a.sc) + c.fr * (a.sc - sc)) > 0;
      |                                                                          ^~
a.cc: In function 'bool cww(std::pair<int, int>, std::pair<int, int>, std::pair<int, int>)':
a.cc:4:12: error: 'second' was not declared in this scope
    4 | #define sc second
      |            ^~~~~~
a.cc:20:74: note: in expansion of macro 'sc'
   20 |     return (a.fr * (b.sc - c.sc) + b.fr * (c.sc - a.sc) + c.fr * (a.sc - sc)) < 0;
      |                                                                          ^~
a.cc: In function 'void f()':
a.cc:29:21: error: could not convert 'ar[1]' from 'pair<std::pair<int, int>,[...]>' to 'pair<int,[...]>'
   29 |         if(!cww(ar[1], ar[i], ar[n]))
      |                 ~~~~^
      |                     |
      |                     pair<std::pair<int, int>,[...]>
a.cc:31:40: error: could not convert 'aa.std::vector<std::pair<std::pair<int, int>, int> >::operator[]((aa.std::vector<std::pair<std::pair<int, int>, int> >::size() - 1))' from 'pair<std::pair<int, int>,[...]>' to 'pair<int,[...]>'
   31 |             while(aa.size() >= 2 && cww(aa[aa.size() - 1], aa[aa.size() - 2], ar[i]))
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        |
      |                                        pair<std::pair<int, int>,[...]>
a.cc:43:20: error: could not convert 'ar[1]' from 'pair<std::pair<int, int>,[...]>' to 'pair<int,[...]>'
   43 |         if(!cw(ar[1], ar[i], ar[n]))
      |                ~~~~^
      |                    |
      |                    pair<std::pair<int, int>,[...]>
a.cc:45:39: error: could not convert 'aa.std::vector<std::pair<std::pair<int, int>, int> >::operator[]((aa.std::vector<std::pair<std::pair<int, int>, int> >::size() - 1))' from 'pair<std::pair<int, int>,[...]>' to 'pair<int,[...]>'
   45 |             while(aa.size() >= 2 && cw(aa[aa.size() - 1], aa[aa.size() - 2], ar[i]))
      |                                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       |
      |                                       pair<std::pair<int, int>,[...]>