Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef  long long ll;

#define pf printf
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) for(int i=(n-1);i>=(0);--i)
#define REPSZ(i,v) REP(i,SZ(v))
#define pll pair <ll, ll>

const ll mxn = 2e5+5;
ll mod = 1e9+7;
bitset<mxn>used;
set<ll>uni;
map<string,ll>index;
ll x[mxn];
ll y[mxn];
ll parent[mxn];
ll Size[mxn];
double eps = 1e-7;
ll n,k;
void print(vector <ll> &v){cout << v.size() << endl;for(int i = 0; i < v.size(); i++){pf("%lld ", v[i]);}pf("\n");}
void print(vector <pll> &v){ cout << v.size() << endl; for(int i = 0; i < v.size(); i++){pf("%lld %lld\n", v[i].first, v[i].second);}}
void print(set<ll> s){set <ll> :: iterator itr;for (itr = s.begin(); itr != s.end(); ++itr){cout << *itr << " ";}cout << endl;}
void print(double d){cout << fixed << setprecision(12) << d << endl;}
void print (ll *arr){REP(i,n)cout << arr[i] << " "; cout << endl;}

void from_file(void){ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);}

/* ------------------main section-------------! */

ll NcR(int n, int r) 
{ 
  
    ll p = 1, k = 1; 
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) { 
        while (r) { 
            p *= n; 
            k *= r; 
  
            ll m = __gcd(p, k); 
            p /= m; 
            k /= m; 
            n--; 
            r--; 
        } 
    } 
  
    else
        p = 1; 
    return p;
} 

ll find(ll a)
{
    if(parent[a]!= a) parent[a] = find(parent[a]);
    return parent[a];
}

void make_set(ll a)
{
    parent[a]=a;
    Size[a] = 1;
}

void Union(ll x, ll y)
{
    x = find(x);
    y = find(y);
    if(x != y) 
    {
        if(Size[x] > Size[y]) swap(x,y);
        parent[y] = x;
        Size[x] += Size[y];
    }
}

void run() {
    fastio;
    ll n;
    cin >> n;
    REP(i,n) make_set(i+1);
    REP(i,n) cin >> x[i+1] >> y[i+1];  
    REP(i,n)
    { 
        used[i+1] = 1;
        for(int j = i+1; j < n; j++)
        {
            if(used[j+1]) continue; 
            if(x[j+1] > x[i+1] && y[j+1] > y[i+1])
            {
                used[j+1] = 1;
                Union(i+1,j+1);
                continue;
            } 
            if(x[j+1] < x[i+1] && y[j+1] < y[i+1])
            {
                used[j+1] = 1;
                Union(i+1,j+1);
                continue;
            }            
        }  
    }
    REP(i,n) cout << Size[find(i+1)] << endl;  
}

int main() {
    #ifndef ONLINE_JUDGE
       from_file();
    #endif
    run();
    return 0;
}


Compiler output:
a.cc:22:15: error: 'std::map<std::__cxx11::basic_string<char>, long long int> index' redeclared as different kind of entity
   22 | map<string,ll>index;
      |               ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~