Language: C++

#include<bits/stdc++.h>
#define N 222222
#define LL long long
using namespace std;
int T,n,i;bool f[N];char s[N];
int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);}
void uni(int x,int y){
	x=fd(x);y=fd(y);
	if(x!=y)F[x]=y;
}
int main(){
	scanf("%d%d%d",&n,&m,&k);
	for(i=1;i<=n;i++)F[i]=i;
	for(i=1;i<=m;i++)scanf("%d%d",&x,&y),uni(x,y);
	for(i=1;i<=n;i++)V[i]=1ll*n*fd(i);
	for(i=1;i<=n;i++)F[i]=i;
	for(i=1;i<=k;i++)scanf("%d%d",&x,&y),uni(x,y);
	for(i=1;i<=n;i++)V[i]+=fd(i);
	for(i=1;i<=n;i++)b[i]=i;
	sort(V+1,V+n+1);
	for(i=1;i<=n;i++){
		if(V[i]!=V[i-1])sz[cnt]=vv,cnt++,vv=1;
		to[b[i]]=cnt;vv++;
	}
}

Compiler output:
a.cc: In function 'int fd(int)':
a.cc:6:22: error: 'F' was not declared in this scope
    6 | int fd(int x){return F[x]==x?x:F[x]=fd(F[x]);}
      |                      ^
a.cc: In function 'void uni(int, int)':
a.cc:9:17: error: 'F' was not declared in this scope
    9 |         if(x!=y)F[x]=y;
      |                 ^
a.cc: In function 'int main()':
a.cc:12:28: error: 'm' was not declared in this scope; did you mean 'tm'?
   12 |         scanf("%d%d%d",&n,&m,&k);
      |                            ^
      |                            tm
a.cc:12:31: error: 'k' was not declared in this scope
   12 |         scanf("%d%d%d",&n,&m,&k);
      |                               ^
a.cc:13:26: error: 'F' was not declared in this scope
   13 |         for(i=1;i<=n;i++)F[i]=i;
      |                          ^
a.cc:14:40: error: 'x' was not declared in this scope
   14 |         for(i=1;i<=m;i++)scanf("%d%d",&x,&y),uni(x,y);
      |                                        ^
a.cc:14:43: error: 'y' was not declared in this scope; did you mean 'yn'?
   14 |         for(i=1;i<=m;i++)scanf("%d%d",&x,&y),uni(x,y);
      |                                           ^
      |                                           yn
a.cc:15:26: error: 'V' was not declared in this scope
   15 |         for(i=1;i<=n;i++)V[i]=1ll*n*fd(i);
      |                          ^
a.cc:16:26: error: 'F' was not declared in this scope
   16 |         for(i=1;i<=n;i++)F[i]=i;
      |                          ^
a.cc:17:40: error: 'x' was not declared in this scope
   17 |         for(i=1;i<=k;i++)scanf("%d%d",&x,&y),uni(x,y);
      |                                        ^
a.cc:17:43: error: 'y' was not declared in this scope; did you mean 'yn'?
   17 |         for(i=1;i<=k;i++)scanf("%d%d",&x,&y),uni(x,y);
      |                                           ^
      |                                           yn
a.cc:18:26: error: 'V' was not declared in this scope
   18 |         for(i=1;i<=n;i++)V[i]+=fd(i);
      |                          ^
a.cc:19:26: error: 'b' was not declared in this scope
   19 |         for(i=1;i<=n;i++)b[i]=i;
      |                          ^
a.cc:20:14: error: 'V' was not declared in this scope
   20 |         sort(V+1,V+n+1);
      |              ^
a.cc:22:33: error: 'sz' was not declared in this scope; did you mean 's'?
   22 |                 if(V[i]!=V[i-1])sz[cnt]=vv,cnt++,vv=1;
      |                                 ^~
      |                                 s
a.cc:22:36: error: 'cnt' was not declared in this scope; did you mean 'int'?
   22 |                 if(V[i]!=V[i-1])sz[cnt]=vv,cnt++,vv=1;
      |                                    ^~~
      |                                    int
a.cc:22:41: error: 'vv' was not declared in this scope
   22 |                 if(V[i]!=V[i-1])sz[cnt]=vv,cnt++,vv=1;
      |                                         ^~
a.cc:23:17: error: 'to' was not declared in this scope; did you mean 'tm'?
   23 |                 to[b[i]]=cnt;vv++;
      |                 ^~
      |                 tm
a.cc:23:20: error: 'b' was not declared in this scope
   23 |                 to[b[i]]=cnt;vv++;
      |                    ^
a.cc:23:26: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |                 to[b[i]]=cnt;vv++;
      |                          ^~~
      |                          int
a.cc:23:30: error: 'vv' was not declared in this scope
   23 |                 to[b[i]]=cnt;vv++;
      |                              ^~