Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long

using namespace std;

bool sortpair(const pair<int,int>& a,const pair<int,int>& b){
    return a.first==b.first ? a.second<b.second : a.first<b.first;
}

int pare[2*100000+1];
int rank[2*100000+1];
int num[2*100000+1];

int find(int p){
    if(p==pare[p])return p;
    return pare[p]=find(pare[p]);
}

void unite(int p,int q){
    p=find(p);
    q=find(q);
    if(p==q)return;
    if(rank[p]>rank[q]){
        pare[q]=p;
        p[num]+=q[num];
    }else{
        pare[p]=q;
        q[num]+=p[num];
        if(rank[p]==rank[q]){
            rank[q]++;
        }
    }
}



int main(){

    int N,K,L;
    cin>>N>>K>>L;
    REP(i,N){
        pare[i+1]=i+1;
        rank[i+1]=0;
    }

    REP(i,K){
        int p,q;
        cin>>p>>q;
        unite(p,q);
    }
    REP(i,N){
        num[i+1]=1;
    }



    REP(i,L){
        int r,s;
        cin>>r>>s;
        if(find(r)==find(s)){
            num[r]+=num[s];
            num[s]=num[r];
        }
    }
    REP(i,N){
        cout<<num[i+1]<<endl;
    }



    return 0;
}

Compiler output:
a.cc: In function 'void unite(int, int)':
a.cc:25:8: error: reference to 'rank' is ambiguous
   25 |     if(rank[p]>rank[q]){
      |        ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~
a.cc:25:16: error: reference to 'rank' is ambiguous
   25 |     if(rank[p]>rank[q]){
      |                ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~
a.cc:31:12: error: reference to 'rank' is ambiguous
   31 |         if(rank[p]==rank[q]){
      |            ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~
a.cc:31:21: error: reference to 'rank' is ambiguous
   31 |         if(rank[p]==rank[q]){
      |                     ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~
a.cc:32:13: error: reference to 'rank' is ambiguous
   32 |             rank[q]++;
      |             ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:45:9: error: reference to 'rank' is ambiguous
   45 |         rank[i+1]=0;
      |         ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:13:5: note:                 'int rank [200001]'
   13 | int rank[2*100000+1];
      |     ^~~~