Language: C++

int main()
{   
    int n, x, y;
    cin >> n;
    vector<pair<int, int>> p;
    for (int i = 0; i < n; i++) {
        cin >> x >> y;
        p.push_back(pair<int, int>(x, y));
    }
    vector<int> arr(n);
    vector<int> skip;
    for (int i = 0; i < n - 1; i++) {
        if (count(skip.begin(), skip.end(), i))
            continue;
        vector<int> group;
        int count = 1;
        group.push_back(i);
        for (int j = i + 1; j < n; j++) {
            if ((p[i].first > p[j].first && p[i].second > p[j].second) || (p[i].first < p[j].first && p[i].second < p[j].second)) {
                count++;
                group.push_back(j);
                skip.push_back(j);
            }
        }
        for (int k : group) {
            arr[k] = count;
        }
    }
    for (int i = 0; i < arr.size(); i++) {
        cout << arr[i] << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<pair<int, int>> p;
      |     ^~~~~~
a.cc:5:12: error: 'pair' was not declared in this scope
    5 |     vector<pair<int, int>> p;
      |            ^~~~
a.cc:5:17: error: expected primary-expression before 'int'
    5 |     vector<pair<int, int>> p;
      |                 ^~~
a.cc:8:9: error: 'p' was not declared in this scope
    8 |         p.push_back(pair<int, int>(x, y));
      |         ^
a.cc:8:26: error: expected primary-expression before 'int'
    8 |         p.push_back(pair<int, int>(x, y));
      |                          ^~~
a.cc:8:31: error: expected primary-expression before 'int'
    8 |         p.push_back(pair<int, int>(x, y));
      |                               ^~~
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector<int> arr(n);
      |            ^~~
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> skip;
      |            ^~~
a.cc:13:19: error: 'skip' was not declared in this scope
   13 |         if (count(skip.begin(), skip.end(), i))
      |                   ^~~~
a.cc:13:13: error: 'count' was not declared in this scope
   13 |         if (count(skip.begin(), skip.end(), i))
      |             ^~~~~
a.cc:15:16: error: expected primary-expression before 'int'
   15 |         vector<int> group;
      |                ^~~
a.cc:17:9: error: 'group' was not declared in this scope
   17 |         group.push_back(i);
      |         ^~~~~
a.cc:19:18: error: 'p' was not declared in this scope
   19 |             if ((p[i].first > p[j].first && p[i].second > p[j].second) || (p[i].first < p[j].first && p[i].second < p[j].second)) {
      |                  ^
a.cc:22:17: error: 'skip' was not declared in this scope
   22 |                 skip.push_back(j);
      |                 ^~~~
a.cc:26:13: error: 'arr' was not declared in this scope
   26 |             arr[k] = count;
      |             ^~~
a.cc:29:25: error: 'arr' was not declared in this scope
   29 |     for (int i = 0; i < arr.size(); i++) {
      |                         ^~~
a.cc:30:9: error: 'cout' was not declared in this scope
   30 |         cout << arr[i] << "\n";
      |         ^~~~