criyle/codenet-compile-errors huggingface dataset:
Language: C++

`#include<iostream>

using namespace std;

const static int MAX_N = 2 * 100000;
int N, K, L;
int roads[MAX_N + 1][MAX_N + 1];

int c_roads[MAX_N + 1];
int c_rails[MAX_N + 1];

void rec_roads(int p, int c) {
  for (int q = p; q <= N; q++) {
    if (roads[p][q] == 1) {
      c_roads[q] = c;
      roads[p][q] = 0;
      roads[q][p] = 0;
      rec_roads(q, c);
    }
  }
}

void rec_rails(int r, int c) {
  for (int s = r; s <= N; s++) {
    if (roads[r][s] == 1) {
      c_rails[s] = c;
      roads[r][s] = 0;
      roads[s][r] = 0;
      rec_rails(s, c);
    }
  }
}

int main() {
  cin >> N >> K >> L;

  for (int i = 1; i <= N; i++) {
    roads[i][i] = 1;
  }

  int p, q;
  for (int i = 1; i <= K; i++) {
    cin >> p >> q;
    roads[p][q] = 1;
    roads[q][p] = 1;
  }
  
  for (p = 1; p <= N; p++) {
    rec_roads(p, p);
  }
  
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      roads[i][j] = 0;
    }
  }

  for (int i = 1; i <= N; i++) {
    roads[i][i] = 1;
  }

  int r, s;
  for (int i = 1; i <= L; i++) {
    cin >> r >> s;
    roads[r][s] = 1;
    roads[s][r] = 1;
  }


  for (r = 1; r <= N; r++) {
    rec_rails(r, r);
  }

  for (int i = 1; i <= N; i++) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (c_roads[i] == c_roads[j] && c_rails[i] == c_rails[j])
        cnt += 1;
    }
    cout << cnt;
    if (i != N)
      cout << " ";
  }
  cout << endl;

  return 0;
}


Compiler output:
a.cc:1:1: error: stray '`' in program
    1 | `#include<iostream>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | `#include<iostream>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | `#include<iostream>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:35:3: error: 'cin' was not declared in this scope
   35 |   cin >> N >> K >> L;
      |   ^~~
a.cc:80:5: error: 'cout' was not declared in this scope
   80 |     cout << cnt;
      |     ^~~~
a.cc:84:3: error: 'cout' was not declared in this scope
   84 |   cout << endl;
      |   ^~~~
a.cc:84:11: error: 'endl' was not declared in this scope
   84 |   cout << endl;
      |           ^~~~
Language: C++

#include<iostream>

using namespace std;

const static int MAX_N = 2 * 100000;
int N, K, L;
int roads[MAX_N + 1][MAX_N + 1];
int rails[MAX_N + 1][MAX_N + 1];

int c_roads[MAX_N + 1];
int c_rails[MAX_N + 1];

void rec_roads(int p, int c) {
  for (int q = p; q<=N; q++) {
    if (roads[p][q] == 1) {
      c_roads[q] = c;
      roads[p][q] = 0;
      roads[q][p] = 0;
      rec_roads(q, c);
    }
  }
}

void rec_rails(int r, int c) {
  for (int s = r; s<=N; s++) {
    if (rails[r][s] == 1) {
      c_rails[s] = c;
      rails[r][s] = 0;
      rails[s][r] = 0;
      rec_rails(s, c);
    }
  }
}

int main() {
  cin >> N >> K >> L;

  for (int i = 1; i <= N; i++) {
    roads[i][i] = 1;
    rails[i][i] = 1;
  }

  int p, q;
  for (int i = 1; i <= K; i++) {
    cin >> p >> q;
    roads[p][q] = 1;
    roads[q][p] = 1;
  }
  
  int r, s;
  for (int i = 1; i <= L; i++) {
    cin >> r >> s;
    rails[r][s] = 1;
    rails[s][r] = 1;
  }

  for (p = 1; p <= N; p++) {
    rec_roads(p, p);
  }

  for (r = 1; r <= N; r++) {
    rec_rails(r, r);
  }

  for (int i = 1; i <= N; i++) {
    int cnt = 0;
    for (int j = 1; j <= N; j++) {
      if (c_roads[i] == c_roads[j] && c_rails[i] == c_rails[j])
        cnt += 1;
    }
    cout << cnt;
    if (i != N)
      cout << " ";
  }
  cout << endl;

  return 0;
}


Compiler output:
/tmp/ccnK1n7S.o: in function `rec_roads(int, int)':
a.cc:(.text+0x55): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccnK1n7S.o
/tmp/ccnK1n7S.o: in function `rec_rails(int, int)':
a.cc:(.text+0x114): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `c_rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x15a): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x185): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
/tmp/ccnK1n7S.o: in function `main':
a.cc:(.text+0x233): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x33e): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x369): relocation truncated to fit: R_X86_64_PC32 against symbol `rails' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x40f): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x426): relocation truncated to fit: R_X86_64_PC32 against symbol `c_roads' defined in .bss section in /tmp/ccnK1n7S.o
a.cc:(.text+0x441): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;

struct UnionFind {
  vector<int> par;
  UnionFind(int n) : par(n, -1) { }
  
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if(x==y)return false;
    if(par[y]<par[x])swap(x,y);
    par[x]+=par[y];par[y]=x;
    return true;
  }
  
  bool same(int x, int y) {
    return root(x) == root(y);
  }
  
  int size(int x) {
    return -par[root(x)];
  }
  int root(int x) {
    return par[x] < 0 ? x : par[x] = root(par[x]);
  }
};;

map<ll,ll>mama;
signed main(){
  ll n,k,l;
  cin>>n>>k>>l;
  UnionFind uni(n);
  UnionFind uni2(n);
  for(int i=0;i<k;i++){
    int p,q;cin>>p>>q;p--;q--;
    uni.unite(p,q);
  }
  for(int i=0;i<l;i++){
    int p,q;cin>>p>>q;p--;q--;
    uni2.unite(p,q);
  }
  vector<pair<int,int> >num1(n);
  vector<pair<int,int> >num2(n);
  for(int i=0;i<n;i++){
    num1[i]=mp(uni.root(i),uni2.root(i));
    num2[i].mp(uni.root(i),uni2.root(i));
  }
  sort(num1.begin(),num1.end());
  
  int cnt=1;
  for(int i=0;i<n-1;i++){
    while(num1[i].F==num1[i+1].F&&num1[i].S==num1[i+1].S&&i!=n-2){
      cnt++;
      i++;
    }
    if(i==n-2&&num1[i].F==num1[i+1].F&&num1[i].S==num1[i+1].S)
      mama[num1[i].F*(1e6)+num1[i].S]=(cnt+1);
    else mama[num1[i].F*(1e6)+num1[i].S]=(cnt);
  }
  for(int i=0;i<n;i++){
    cout<<mama[num2[i].F*(1e6)+num2[i].S];
    if(i!=n-1)
      cout<<" ";
  }
  cout<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'struct std::pair<long long int, long long int>'} has no member named 'make_pair'
    7 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:61:13: note: in expansion of macro 'mp'
   61 |     num2[i].mp(uni.root(i),uni2.root(i));
      |             ^~
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e10;
struct UnionFind {
    vector<int> par;
    UnionFind(int n) : par(n, -1) { }

    bool unite(int x, int y) {
        x = root(x); y = root(y);
        if(x==y)return false;
        if(par[y]<par[x])swap(x,y);
        par[x]+=par[y];par[y]=x;
        return true;
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    int size(int x) {
        return -par[root(x)];
    }
    int root(int x) {
        return par[x] < 0 ? x : par[x] = root(par[x]);
    }
};

map<ll,ll>mama;
int main(){
  ll n,k,l;
  cin>>n>>k>>l;
  UnionFind uni(n);
  UnionFind uni2(n);
  for(int i=0;i<k;i++){
    int p,q;cin>>p>>q;p--;q--;
    uni.unite(p,q);
  }
  for(int i=0;i<l;i++){
    int p,q;cin>>p>>q;p--;q--;
    uni2.unite(p,q);
  }
  vector<pair<int,int> >num1(n);
  for(int i=0;i<n;i++){
    num1[i]=mp(uni.root(i),uni2.root(i));
  }
  sort(num1.begin(),num1.end());

  int cnt=1;
  for(int i=0;i<n-1;i++){
    while(num1[i].F==num1[i+1].F&&num1[i].S==num1[i+1].S&&i!=n-2){
      cnt++;
      i++;
    }
    if(i==n-2&&num1[i].F==num1[i+1].F&&num1[i].S==num1[i+1].S)
      mama[num1[i].F*(1e6)+num1[i].S]=(cnt+1);
    else mama[num1[i].F*(1e6)+num1[i].S]=(cnt);
  }
  for(int i=0;i<n;i++){
    cout<<mama[num1[i].F*(1e6)+num1[i].S];
    f(i!=n-1)
      cout<<" ";
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc:5:13: error: expected unqualified-id before numeric constant
    5 | #define MOD 1e9+7
      |             ^~~
a.cc:18:11: note: in expansion of macro 'MOD'
   18 | const int MOD=1e9+7;
      |           ^~~
a.cc:3:13: error: expected unqualified-id before numeric constant
    3 | #define INF 1e9
      |             ^~~
a.cc:19:11: note: in expansion of macro 'INF'
   19 | const int INF=1e10;
      |           ^~~
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:76:5: error: 'f' was not declared in this scope
   76 |     f(i!=n-1)
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

vector<int> R, T;

int find_node_r(int now){
    if(now == R[now]) return now;
    else{
        int ans = find_node_r(R[now]);
        R[now] = ans;
        return ans;
    }
}

int find_node_t(int now){
    if(now == T[now]) return now;
    else{
        int ans = find_node_t(T[now]);
        T[now] = ans;
        return ans;
    }
}

int main(){
    int n, k, l;
    cin >> n >> k >> l;
    R.resize(n); T.resize(n);
    for(int i = 0; i < n; i++){
        R[i] = i; T[i] = i;
    }

    for(int i = 0; i < k; i++){
        int p, q;
        cin >> p >> q;
        p--; q--;
        R[find_node_r(p)] = find_node_r(q); 
    }

    for(int i = 0; i < l; i++){
        int r, s;
        cin >> r >> s;
        r--; s--;
        T[find_node_t(r)] = find_node_t(s); 
    }

    
    int A[n] = {};
    for(int i = 0; i < n; i++){
        if(D[])
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:12: error: 'D' was not declared in this scope
   49 |         if(D[])
      |            ^
a.cc:49:14: error: expected primary-expression before ']' token
   49 |         if(D[])
      |              ^
a.cc:50:5: error: expected primary-expression before '}' token
   50 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 2*1e5;
int n;
int Find(int *f, int x)
{
    if(f[x] == x)
        return x;
    else
    {
        f[x] = Find(f, f[x]);
        return f[x];
    }
}
void Merge(int *f, int x, int y)
{
    x = Find(f, x);
    y = Find(f, y);
    if(x != y)
        f[y] = x;
}
int f[N], g[N], vis[N];
vector<int> vec[N];
map<int, int> q;
void init()
{
    for(int i = 0; i <= n; i++)
        f[i] = g[i] = i;
}
int main()
{
    int k, l, u, v;
    scanf("%d %d %d", &n, &k, &l)
    init();
    while(k--)
    {
        scanf("%d %d", &u, &v);
        Merge(f, u, v);
    }
    while(l--)
    {
        scanf("%d %d", &u, &v);
        Merge(g, u, v);
    }
    memset(vis, 0, sizeof(vis));
    for(int i = 1; i <= n; i++) vec[Find(f, i)].push_back(i);
    for(int i = 1; i <= n; i++)
    {
        q.clear();
        for(int j = 0; j < vec[i].size(); j++)
        {
            q[Find(g, vec[i][j])]++;
        }
        for(int j = 0; j < vec[i].size(); j++)
        {
            vis[vec[i][j]] += q[Find(g, vec[i][j])];
        }
    }
    for(int i = 1; i <= n; i++)
    {
        printf("%d", vis[i]);
        if(i == n) printf("\n");
        else printf(" ");
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:34: error: expected ';' before 'init'
   33 |     scanf("%d %d %d", &n, &k, &l)
      |                                  ^
      |                                  ;
   34 |     init();
      |     ~~~~
Language: C++

#include <iostream>
#include <math.h>
#include <bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define maxn 310000
using namespace std;
struct node
{
    int x,y;
};
map<pair<int,int>,int>mp;
NIT(int a[],int n)
{
    for(int i=1; i<=n; i++)
        a[i]=i;
}
int Find(int a[],int x)
{
    return a[x]==x?x:a[x]=Find(a,a[x]);
}
void marge(int a[],int x,int y)
{
    int fx=Find(a,x);
    int fy=Find(a,y);
    if(fx!=fy)
    {
        a[fx]=fy;
    }
}
int main()
{
    int a[200100],b[200100];
    int n,k,l,i,j,u,v;
    scanf("%d%d%d",&n,&k,&l);
    NIT(a,n);
    NIT(b,n);
    for(int i=1; i<=k; i++)
    {
        scanf("%d%d",&u,&v);
        marge(a,u,v);
    }
    for(int i=1; i<=l; i++)
    {
        scanf("%d%d",&u,&v);
        marge(b,u,v);
    }
    node tp;
    for(int i=1; i<=n; i++)
    {
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        mp[ {tp.x,tp.y}]++;
    }
    int first=1;
    for(int i=1; i<=n; i++)
    {
        if(!first) printf(" ");
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        printf("%d",mp[ {tp.x,tp.y}]);
        first=0;
    }
    printf("\n");
    return 0;
}


Compiler output:
a.cc:13:1: error: ISO C++ forbids declaration of 'NIT' with no type [-fpermissive]
   13 | NIT(int a[],int n)
      | ^~~
a.cc: In function 'int NIT(int*, int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
Language: C++

#include<iostream>
#include <math.h>
#include <bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define maxn 310000
using namespace std;
struct node
{
    int x,y;
};
map<pair<int,int>,int>mp;
Init(int a[],int n)
{
    for(int i=1;i<=n;i++)
        a[i]=i;
}
int Find(int a[],int x)
{
    return a[x]==x?x:a[x]=Find(a,a[x]);
}
void marge(int a[],int x,int y)
{
    int fx=Find(a,x);
    int fy=Find(a,y);
    if(fx!=fy)
    {
        a[fx]=fy;
    }
}
int main()
{
    int a[200100],b[200100];
    int n,k,l,i,j,u,v;
    scanf("%d%d%d",&n,&k,&l);
    Init(a,n);
    Init(b,n);
    for(int i=1;i<=k;i++)
    {
        scanf("%d%d",&u,&v);
        marge(a,u,v);
    }
    for(int i=1;i<=l;i++)
    {
        scanf("%d%d",&u,&v);
        marge(b,u,v);
    }
    node tp;
    for(int i=1;i<=n;i++)
    {
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        mp[{tp.x,tp.y}]++;
    }
    int first=1;
    for(int i=1;i<=n;i++)
    {
        if(!first) printf(" ");
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        printf("%d",mp[{tp.x,tp.y}]);
        first=0;
    }
    printf("\n");
    return 0;
}


Compiler output:
a.cc:13:1: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive]
   13 | Init(int a[],int n)
      | ^~~~
a.cc: In function 'int Init(int*, int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
Language: C++

#include<iostream>
#include <math.h>
#include <bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define maxn 310000
using namespace std;
struct node
{
    int x,y;
};
map<pair<int,int>,int>mp;
init(int a[],int n)
{
    for(int i=1;i<=n;i++)
        a[i]=i;
}
int Find(int a[],int x)
{
    return a[x]==x?x:a[x]=Find(a,a[x]);
}
void marge(int a[],int x,int y)
{
    int fx=Find(a,x);
    int fy=Find(a,y);
    if(fx!=fy)
    {
        a[fx]=fy;
    }
}
int main()
{
    int a[200100],b[200100];
    int n,k,l,i,j,u,v;
    scanf("%d%d%d",&n,&k,&l);
    init(a,n);
    init(b,n);
    for(int i=1;i<=k;i++)
    {
        scanf("%d%d",&u,&v);
        marge(a,u,v);
    }
    for(int i=1;i<=l;i++)
    {
        scanf("%d%d",&u,&v);
        marge(b,u,v);
    }
    node tp;
    for(int i=1;i<=n;i++)
    {
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        mp[{tp.x,tp.y}]++;
    }
    int first=1;
    for(int i=1;i<=n;i++)
    {
        if(!first) printf(" ");
        tp.x=Find(a,i);
        tp.y=Find(b,i);
        printf("%d",mp[{tp.x,tp.y}]);
        first=0;
    }
    printf("\n");
    return 0;
}


Compiler output:
a.cc:13:1: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
   13 | init(int a[],int n)
      | ^~~~
a.cc: In function 'int init(int*, int)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
Language: C++

#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define FOR(i,x,y) for(int i=(x);i<(int)(y);i++)
#define FORP(i,x,y) for(int i=(x);i<=(int)(y);i++)
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for(int i=1;i<=(int)(y);i++)
#define REPB(i,n) for(int i=(int)(n)-1;i>=0;i--)

int N,K,L;

class UnionFind {
  vector<int> p;  // rank
public:
  UnionFind (int n) : p(n, -1) {}
  int root(int x) {
    return p[x] < 0 ? x : p[x] = root(p[x]);
  }
  bool same(int x, int y) {
    return root(x) == root(y);
  }
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (p[y] < p[x]) swap(x, y);
    if (p[x] == p[y]) --p[x];
    p[y] = x;
    return true;
  }
};

unordered_multimap<int, int> mp1;
unordered_multimap<int, int> mp2;

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);
  cin >> N >> K >> L;
  UnionFind uf1(N), uf2(N);
  REP(i,K) {
    int p,q; cin>>p>>q; p--,q--;
    uf1.unite(p,q);
  }
  REP(i,L) {
    int r,s; cin>>r>>s; r--,s--;
    uf2.unite(r,s);
  }
  REP(i,N) {
    mp1.emplace(uf1.root(i), i);
    mp2.emplace(uf2.root(i), i);
  }
  REP(i,N) {
    int cnt=0;
    auto p1 = mp1.equal_range(uf1.root(i));
    auto p2 = mp2.equal_range(uf2.root(i));
    auto it1 = p1.first;
    auto it2 = p2.first;
    while (it1!=p1.second && it2!=p2.second) {
      int s = it1->second;
      int t = it2->second;
      if (s==t) cnt++, it2++;
      if (s<t)  it1++;
      if (s>t)  it2++;
    }
    cout << cnt << " ";
  }
  cout << endl;
}


Compiler output:
a.cc:42:1: error: 'unordered_multimap' does not name a type
   42 | unordered_multimap<int, int> mp1;
      | ^~~~~~~~~~~~~~~~~~
a.cc:43:1: error: 'unordered_multimap' does not name a type
   43 | unordered_multimap<int, int> mp2;
      | ^~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:58:5: error: 'mp1' was not declared in this scope
   58 |     mp1.emplace(uf1.root(i), i);
      |     ^~~
a.cc:59:5: error: 'mp2' was not declared in this scope
   59 |     mp2.emplace(uf2.root(i), i);
      |     ^~~
a.cc:63:15: error: 'mp1' was not declared in this scope; did you mean 'p1'?
   63 |     auto p1 = mp1.equal_range(uf1.root(i));
      |               ^~~
      |               p1
a.cc:64:15: error: 'mp2' was not declared in this scope; did you mean 'p2'?
   64 |     auto p2 = mp2.equal_range(uf2.root(i));
      |               ^~~
      |               p2
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;
typedef pair<long long, long long> pii;
typedef pair<long long, pair<int, int> > triple;

#define REP(i, n) for(int i=0; i<n; i++)

int const max_n = 100000;
int n, k, l;
int c[max_n];
bool road[max_n][max_n];
int par1[max_n], par2[max_n];
int r1[max_n], r2[max_n];

void init(int n, int (&par)[max_n], int (&r)[max_n]){
    REP(i, n){
        par[i] = i;
        r[i] = 0;
    }
}

int find(int x, int (&par)[max_n]){
    if(par[x] == x){
        return x;
    } else {
        return par[x] = find(par[x], par);
    }
}

void unite(int x, int y, int (&par)[max_n], int (&r)[max_n]){
    x = find(x, par);
    y = find(y, par);

    if(x == y) return;
    if(r[x] < r[y]){
        par[x] = y;
    } else {
        par[y] = x;
        if(r[x] == r[y]) r[x]++;
    }
}

bool same(int x, int y, int (&par)[max_n]){
    return find(x, par) == find(y, par);
}

int main(){
    cin >> n >> k >> l;
    init(n, par1, r1);
    REP(i, k){
        int p, q;
        cin >> p >> q;
        unite(p-1, q-1, par1, r1);
    }
    init(n, par2, r2);
    REP(i, l){
        int r, s;
        cin >> r >> s;
        if(same(r-1, s-1, par1)){
            unite(r-1, s-1, par2, r2);
        }
    }

    REP(i, n) c[i] = 0;
    REP(i, n) c[find(i, par2)] += 1;
    REP(i, n){
        cout << c[find(i, par2)];
        if(i<n-1){
            cout << " ";
        } else {
            cout << endl;
        }
    }
}


Compiler output:
/tmp/ccMnmC38.o: in function `main':
a.cc:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `r1' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x209): relocation truncated to fit: R_X86_64_PC32 against symbol `par1' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x257): relocation truncated to fit: R_X86_64_PC32 against symbol `r1' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x261): relocation truncated to fit: R_X86_64_PC32 against symbol `par1' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x284): relocation truncated to fit: R_X86_64_PC32 against symbol `r2' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x28b): relocation truncated to fit: R_X86_64_PC32 against symbol `par2' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x2d9): relocation truncated to fit: R_X86_64_PC32 against symbol `par1' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x2f9): relocation truncated to fit: R_X86_64_PC32 against symbol `r2' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x303): relocation truncated to fit: R_X86_64_PC32 against symbol `par2' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x35f): relocation truncated to fit: R_X86_64_PC32 against symbol `par2' defined in .bss section in /tmp/ccMnmC38.o
a.cc:(.text+0x3b7): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
#define int long long
#define str string
#define rep(i,j) for(int i=0;i<(int)(j);i++)
typedef long long ll;
typedef long double ld;
const ll inf = 999999999999999999;
const ld pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct S {//辺の情報を入れる変数
	int from, to, cost;
};
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
int n,k,l;
int pa[200001],pb[200001];
int root1(int x){
	if(pa[x]==x) return x;
	return pa[x]=root1(pa[x]);
}
int root2(int x){
	if(pb[x]==x) return x;
	return pb[x]=root2(x);
}
void unite1(int a,int b){
	pa[root1(a)]=root1(b);
}
void unite2(int a,int b){
	pb[root2(a)]=root2(b);
}
struct A{
	int a,b;
};
signed main() {
	cin>>n>>k>>l;
	for(int i=1;i<=n;i++){
		pa[i]=i,pb[i]=i;
	}
	for(int i=0;i<k;i++){
		int u1,u2;
		cin>>u1>>u2;
		unite(u1,u2);
	}
	for(int i=0;i<l;i++){
		int u1,u2;
		cin>>u1>>u2;
		unite(u1,u2);
	}
	
	getchar(); getchar();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:17: error: 'unite' was not declared in this scope; did you mean 'unite2'?
   69 |                 unite(u1,u2);
      |                 ^~~~~
      |                 unite2
a.cc:74:17: error: 'unite' was not declared in this scope; did you mean 'unite2'?
   74 |                 unite(u1,u2);
      |                 ^~~~~
      |                 unite2
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
#define pii pair<int,int>
map<pii, int> Map;
int n,m,k;
int UF[2][201000];
int Find(int pv, int a) {
  if(UF[pv][a] = a) return a;
  return UF[pv][a] = Find(pv, UF[pv][a]);
}
void Merge(int pv, int a, int b) {
  a = Find(pv, a);
  b = Finf(pv, b);
  if(a != b) UF[pv][a] = b;
}
int main(){
  int i, a, b;
  scanf("%d%d%d",&n,&m,&k);
  for(i=1;i<=n;i++)UF[0][i]=UF[1][i]=i;
  for(i=0;i<m;i++){
    cin>>a>>b;
    Merge(0,a,b);
  }
  for(i=0;i<k;i++){
    cin>>a>>b;
    Merge(1,a,b);
  }
  for(i=1;i<=n;i++){
    Map[pii(Find(0,i),Find(1,i))]++
  }
  for(i=1;i<=n;i++){
    printf("%d%c",Map[pii(Find(0,i),Find(1,i))],i==n-1?'\n':' ');
  }
  return 0;
}

Compiler output:
a.cc: In function 'void Merge(int, int, int)':
a.cc:28:7: error: 'Finf' was not declared in this scope; did you mean 'sinf'?
   28 |   b = Finf(pv, b);
      |       ^~~~
      |       sinf
a.cc: In function 'int main()':
a.cc:44:36: error: expected ';' before '}' token
   44 |     Map[pii(Find(0,i),Find(1,i))]++
      |                                    ^
      |                                    ;
   45 |   }
      |   ~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;
#define pii pair<int,int>
map<pii, int> Map;
int n,m,k;
int UF[2][201000];
int Find(int pv, int a) {
  if(UF[pv][a] = a) return a;
  return UF[pv][a] = Find(pv, UF[pv][a]);
}
void Merge(int pv, int a, int b) {
  a = Find(pv, a);
  b = Finf(pv, b);
  if(a != b) UF[pv][a] = b;
}
int main(){
  int i, a, b;
  scanf("%d%d%d",&n,&m,&k);
  for(i=1;i<=n;i++)UF[0][i]=UF[1][i]=i;
  for(i=0;i<m;i++){
    cin>>a>>b;
    Merge(0,a,b);
  }
  for(i=0;i<k;i++){
    cin>>a>>b;
    Merge(1,a,b);
  }
  for(i=1;i<=n;i++){
    MAP[pii(Find(0,i),Find(1,i))]++
  }
  for(i=1;i<=n;i++){
    printf("%d%c",MAP[pii(Find(0,i),Find(1,i))],i==n-1?'\n':' ');
  }
  return 0;
}


Compiler output:
a.cc: In function 'void Merge(int, int, int)':
a.cc:15:7: error: 'Finf' was not declared in this scope; did you mean 'Find'?
   15 |   b = Finf(pv, b);
      |       ^~~~
      |       Find
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope
   23 |     cin>>a>>b;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<map>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>a>>b;
      |     ^~~
a.cc:27:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:5: error: 'MAP' was not declared in this scope; did you mean 'Map'?
   31 |     MAP[pii(Find(0,i),Find(1,i))]++
      |     ^~~
      |     Map
a.cc:34:19: error: 'MAP' was not declared in this scope; did you mean 'Map'?
   34 |     printf("%d%c",MAP[pii(Find(0,i),Find(1,i))],i==n-1?'\n':' ');
      |                   ^~~
      |                   Map
Language: C++

#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;
#define pii pair<int,int>
map<pii, int> Map;
int n,m,k;
int UF[2][201000];
int Find(int pv, int x) {
  if(UF[pv][a] = a) return a;
  return UF[pv][a] = Find(pv, UF[pv][a]);
}
void Merge(int pv, int a, int b) {
  a = Find(pv, a);
  b = Finf(pv, b);
  if(a != b) UF[pv][a] = b;
}
int main(){
  int i, a, b;
  scanf("%d%d%d",&n,&m,&k);
  for(i=1;i<=n;i++)UF[0][i]=UF[1][i]=i;
  for(i=0;i<m;i++){
    cin>>a>>b;
    Merge(0,a,b);
  }
  for(i=0;i<k;i++){
    cin>>a>>b;
    Merge(1,a,b);
  }
  for(i=1;i<=n;i++){
    MAP[pii(Find(0,i),Find(1,i))]++
  }
  for(i=1;i<=n;i++){
    printf("%d%c",MAP[pii(Find(0,i),Find(1,i))],i==n-1?'\n':' ');
  }
  return 0;
}


Compiler output:
a.cc: In function 'int Find(int, int)':
a.cc:10:13: error: 'a' was not declared in this scope
   10 |   if(UF[pv][a] = a) return a;
      |             ^
a.cc:11:17: error: 'a' was not declared in this scope
   11 |   return UF[pv][a] = Find(pv, UF[pv][a]);
      |                 ^
a.cc: In function 'void Merge(int, int, int)':
a.cc:15:7: error: 'Finf' was not declared in this scope; did you mean 'Find'?
   15 |   b = Finf(pv, b);
      |       ^~~~
      |       Find
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope
   23 |     cin>>a>>b;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<map>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>a>>b;
      |     ^~~
a.cc:27:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:5: error: 'MAP' was not declared in this scope; did you mean 'Map'?
   31 |     MAP[pii(Find(0,i),Find(1,i))]++
      |     ^~~
      |     Map
a.cc:34:19: error: 'MAP' was not declared in this scope; did you mean 'Map'?
   34 |     printf("%d%c",MAP[pii(Find(0,i),Find(1,i))],i==n-1?'\n':' ');
      |                   ^~~
      |                   Map
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
using namespace std;
typedef long long ll;
 
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define FOREACH(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
 
struct UnionFind {
   vector<int> node;
   UnionFind(int n) : node(n,-1) {}
   bool union(int x, int y) {
      x = root(x); 
      y = root(y);
      if (x != y) {
         if (node[y] < node[x]) swap(x, y);
         node[x] += node[y]; 
         node[y] = x;
      }
      return x != y;
   }
   bool isSame(int x, int y) {
      return root(x) == root(y);
   }
   int root(int x) {
      return node[x] < 0 ? x : node[x] = root(node[x]);
   }
   int size(int x) {
      return -node[root(x)];
   }
};
 
int main(){
 
    int N,K,L; cin>>N>>K>>L;
    UnionFind inst1(200010);
    UnionFind inst2(200010);
    REP(i,K){
        int p,q; cin>>p>>q;
        inst1.union(p,q);
    }
    REP(i,L){
        int r,s; cin>>r>>s;
        inst2.union(r,s);
    }
    
    map<int,vector<int> > same_g;
    for(int i=1;i<=N;i++){
        same_g[inst1.root(i)].push_back(i);
    }
    
    int ans[200010]={};
    FOREACH(i,same_g){
        vector<int> t=i->second;
        map<int,int> root;
        REP(j,t.size()){
            int r=inst2.root(t[j]);
            if(root.find(r)==root.end())root[r]=1;
            else root[r]++;
        }
        REP(j,t.size())ans[t[j]]=root[inst2.root(t[j])];
    }
    
    for(int i=1;i<N;i++){
        cout<<ans[i]<<" ";
    }
    cout<<ans[N]<<endl;
    
    return 0;
}

Compiler output:
a.cc:27:14: error: expected identifier before '(' token
   27 |    bool union(int x, int y) {
      |              ^
a.cc:27:15: error: expected unqualified-id before 'int'
   27 |    bool union(int x, int y) {
      |               ^~~
a.cc:27:15: error: expected ')' before 'int'
   27 |    bool union(int x, int y) {
      |              ~^~~
      |               )
a.cc: In function 'int main()':
a.cc:55:15: error: expected unqualified-id before 'union'
   55 |         inst1.union(p,q);
      |               ^~~~~
a.cc:59:15: error: expected unqualified-id before 'union'
   59 |         inst2.union(r,s);
      |               ^~~~~
Language: C++

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N,K,L;
	cin >> N >> K >> L;
	UnionFind ufA(N),ufB(N);
	for(int i=0;i<K;++i){
		int x,y;
		cin >> x >> y;
		--x;--y;
		ufA.add(x,y);
	}
	for(int i=0;i<L;++i){
		int x,y;
		cin >> x >> y;
		--x;--y;
		ufB.add(x,y);
	}
	
	map<pair<LL,LL>,int> pmap;
	for(int i=0;i<N;++i){
		pair<LL,LL> temp;
		temp.first = ufA.find(i);
		temp.second = ufB.find(i);
		pmap[temp]++;
	}
	for(int i=0;i<N;++i){
		if( i!=0 ){
			cout << " ";
		}
		pair<LL,LL> temp;
		temp.first = ufA.find(i);
		temp.second = ufB.find(i);
		cout << pmap[ temp ];
	}
	cout << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	
	
	solve();
}
#pragma endregion //main()


Compiler output:
a.cc: In function 'void solve()':
a.cc:50:9: error: 'UnionFind' was not declared in this scope
   50 |         UnionFind ufA(N),ufB(N);
      |         ^~~~~~~~~
a.cc:55:17: error: 'ufA' was not declared in this scope
   55 |                 ufA.add(x,y);
      |                 ^~~
a.cc:61:17: error: 'ufB' was not declared in this scope
   61 |                 ufB.add(x,y);
      |                 ^~~
a.cc:67:30: error: 'ufA' was not declared in this scope
   67 |                 temp.first = ufA.find(i);
      |                              ^~~
a.cc:68:31: error: 'ufB' was not declared in this scope
   68 |                 temp.second = ufB.find(i);
      |                               ^~~
a.cc:76:30: error: 'ufA' was not declared in this scope
   76 |                 temp.first = ufA.find(i);
      |                              ^~~
a.cc:77:31: error: 'ufB' was not declared in this scope
   77 |                 temp.second = ufB.find(i);
      |                               ^~~
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long int ll;
const MOD (1e9+7);
const INF (2e9);
const MAX_N (20001);

int par_road[MAX_N];
int rank_road[MAX_N];
int par_train[MAX_N];
int rank_train[MAX_N];



struct PARENT{
    int num;//num 番目の都市は（問題上では1番目～n番目だが、0番目～n-1番目と表記することにする）
    int road;//道に関するUnion-Find木でroad番目の都市を親に持ち
    int train;//線路に関するUnion-Find木でtrain番目の都市を親に持つ
};

bool cmp(const PARENT a,const PARENT b){//sort用関数　roadで昇順ソート、roadが等しかったらtrainで昇順
    if(a.road==b.road){
        return a.train<b.train;
    }else{
        return a.road<b.road;
    }
}

void init(int n,int *par,int *rank){//Unioo-Find木を生成
    for(int i=0;i<n;i++){
        par[i]=i;
        rank[i]=0;
    }
}

int find(int x,int *par){//根探し
    if(par[x]==x){
        return x;
    }else{
        return par[x]=find(par[x],par);
    }
}

void unite(int x, int y,int *par,int *rank){//連結
    x=find(x,par);
    y=find(y,par);
    if(x==y) return;

    if(rank[x]<rank[y]){
        par[x]=y;
    }else{
        par[y]=x;
        if(rank[x]==rank[y]){
            rank[x]++;
        }
    }
}

bool same(int x,int y,int *par){//根が等しいか判定
    return find(x,par)==find(y,par);
}

int main(void) {
    int n,k,l;
    cin>>n>>k>>l;

    init(n,par_road,rank_road);//道についてのUnion-Find木を生成
    init(n,par_train,rank_train);//線路についてのUnion-Find木を生成
    int p,q,r,s;
    for(int i=0;i<k;i++){//道の情報によって連結していく
        cin>>p>>q;
        unite(p-1,q-1,par_road,rank_road);//0~n-1番目の道　としたので　p-1 q-1
    }
    for(int i=0;i<l;i++){//線路の情報によって連結していく
        cin>>r>>s;
        unite(r-1,s-1,par_train,rank_train);
    }

    PARENT *parent=new PARENT[n];
    for(int i=0;i<n;i++){//num番目の都市は　road番目の都市を道根に持ち、train番目の都市を線路根に持つ
        parent[i].num=i;
        parent[i].road=find(i,par_road);
        parent[i].train=find(i,par_train);
    }




    sort(parent,parent+n,cmp);


    int *answer=new int[n];
    int memo_start=0,count=1;
    int i;

    for(i=1;i<n;i++){
        if(parent[i].road==parent[i-1].road && parent[i].train==parent[i-1].train){
            count++;
        }else{
            for(memo_start;memo_start<i;memo_start++){//memo_startは現在の位置を指して終わる
                answer[(parent[memo_start]).num]=count;
            }
            count=1;
        }
    }

 
    for(memo_start;memo_start<i;memo_start++){
        answer[parent[memo_start].num]=count;
    }

    for(int i=0;i<n;i++){
        cout<<answer[i]<<" ";
    }
    cout<<endl;

    return 0;
}

Compiler output:
a.cc:7:7: error: ISO C++ forbids declaration of 'MOD' with no type [-fpermissive]
    7 | const MOD (1e9+7);
      |       ^~~
a.cc:8:7: error: ISO C++ forbids declaration of 'INF' with no type [-fpermissive]
    8 | const INF (2e9);
      |       ^~~
a.cc:9:7: error: ISO C++ forbids declaration of 'MAX_N' with no type [-fpermissive]
    9 | const MAX_N (20001);
      |       ^~~~~
Language: C++

#include<iostream>
#include<unordered_map>
#include<cstdio>
using namespace std;

int par0[200000], rank0[200000], par1[200000], rank1[200000];
int find0(int a) {
	if (par0[a] == a)return a;
	return par0[a] = find0(par0[a]);
}
void unite0(int a, int b) {
	a = find0(a);
	b = find0(b);
	if (rank0[a]>rank0[b]) {
		par0[b] = a;
	}
	else if (rank0[a]<rank0[b]) {
		par0[a] = b;
	}
	else {
		par0[b] = a;
		rank0[a]++;
	}
}
int find1(int a) {
	if (par1[a] == a)return a;
	return par1[a] = find1(par1[a]);
}
void unite1(int a, int b) {
	a = find1(a);
	b = find1(b);
	if (rank1[a]>rank1[b]) {
		par1[b] = a;
	}
	else if (rank1[a]<rank1[b]) {
		par1[a] = b;
	}
	else {
		par1[b] = a;
		rank1[a]++;
	}
}
int main() {
	int a, b, c; cin >> a >> b >> c;
	for (int d = 0; d< a; d++) {
		par0[d] = d;
		par1[d] = d;
	}
	for (int d = 0; d< b; d++) {
		int e, f; scanf("%d%d", &e, &f); e--; f--;
		unite0(e, f);
	}
	for (int d = 0; d< c; d++) {
		int e, f; scanf("%d%d", &e, &f); e--; f--;
		unite1(e, f);
	}
	unordered_map<int, unordered_map<int,int>>U;
	for (int d = 0; d< a; d++) {
		U[find0(d)][find1(d)]++;
	}
	for (int i = 0; i < a; i++) {
		if (i)printf(" ");
		printf("%d", U[find0(d)][find1(d)]);
	}
	puts("");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:38: error: 'd' was not declared in this scope
   63 |                 printf("%d", U[find0(d)][find1(d)]);
      |                                      ^
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int uf1[200010], uf2[200010];
int find(int x, int uf[]) {
    if(uf[x] == x) return x;
    else return find(uf[x], uf);
}

void unite(int a, int b, int uf[]) {
    if(uf[a] == uf[b]) return;
    uf[b] = find(a, uf);
}

signed main() {
    int n, k, l; cin >> n >> k >> l;
    iota(uf1, uf1+n, 0);
    iota(uf2, uf2+n, 0);
    rep(i,0,k) {
        int p, q; cin >> p >> q;
        p--; q--;
        unite(p, q, uf1);
    }
    rep(i,0,l) {
        int r, s; cin >> r >> s;
        r--; s--;
        unite(r, s, uf2);
    }

    map<pii, int> m;
    rep(i,0,n) {
        int f1 = find(i, uf1);
        int f2 = find(i, uf2);
        pii temp = pii(f1, f2);
        if(!m.count(temp)) m[temp] = 1;
        else m[temp] += 1;
    }

    rep(i,0,n) {
        int f1 = find(i, uf1);
        int f2 = find(i, uf2);
        int ret = m[ pii(f1, f2) ];
        if(i == 0) printf("%lld", ret);
        else printf(" %lld", ret);
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:5: error: 'iota' was not declared in this scope
   76 |     iota(uf1, uf1+n, 0);
      |     ^~~~
Language: C++

def inp() a=gets.chomp.split(" ").map(&:to_i)end 
def inpf() a=gets.chomp.split(" ").map(&:to_f)end
def inps() a=gets.chomp.split(" ")end  
def copy(a) Marshal.load(Marshal.dump(a)) end
def kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end
def scount(a) b = na(a.max+1); a.each{|n|b[n]+=1};return b end
def na(n=0,d=0) Array.new(n,d)end
def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
def saiki(d,i,now,dd,j)
  return if(dd[i] == now) if(j == 0)
  dd[i] = now 
  d[i].each do|t|
    saiki(d,t,now,dd,0)
  end
end
h = {}
n,k,l = inp
dk = na2(n+1,0)
da = na(n+1)
dl = na2(n+1,0)
db = na(n+1)
(n+1).times do |i|
  da[i] = i
  db[i] = i
end
(k).times do |i|
  d = inp
  dk[d[0]].push(d[1])
  dk[d[1]].push(d[0])
end
(l).times do |i|
  d = inp
  dl[d[0]].push(d[1])
  dl[d[1]].push(d[0])
end
(n+1).times do |i|
  if(da[i] == i)
    saiki(dk,i,i,da,1)
  end
end
(n+1).times do |i|
  if(db[i] == i)
    saiki(dl,i,i,db,1)
  end
end
h ={}
(1..n).each do |i|
  h[[da[i],db[i]]] = 0 if(h[[da[i],db[i]]] == nil)
  h[[da[i],db[i]]] += 1
end
(1..n-1).each do |i|
  print "#{h[[da[i],db[i]]]} " 
end
puts h[[da[n],db[n]]]
=begin
max = c if max < c 
=end

Compiler output:
a.cc:5:28: error: too many decimal points in number
    5 | def kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end
      |                            ^~~~
a.cc:48:2: error: too many decimal points in number
   48 | (1..n).each do |i|
      |  ^~~~
a.cc:52:2: error: too many decimal points in number
   52 | (1..n-1).each do |i|
      |  ^~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def inp() a=gets.chomp.split(" ").map(&:to_i)end
      | ^~~
a.cc:6:32: error: 'a' does not name a type
    6 | def scount(a) b = na(a.max+1); a.each{|n|b[n]+=1};return b end
      |                                ^
a.cc:6:51: error: expected unqualified-id before 'return'
    6 | def scount(a) b = na(a.max+1); a.each{|n|b[n]+=1};return b end
      |                                                   ^~~~~~
a.cc:8:46: error: 'end' does not name a type
    8 | def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end
      |                                              ^~~
a.cc:9:62: error: 'end' does not name a type
    9 | def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end
      |                                                              ^~~
a.cc:18:1: error: 'n' does not name a type
   18 | n,k,l = inp
      | ^
a.cc:48:2: error: expected unqualified-id before numeric constant
   48 | (1..n).each do |i|
      |  ^~~~
a.cc:48:2: error: expected ')' before numeric constant
   48 | (1..n).each do |i|
      | ~^~~~
      |  )
Language: C++

#include<cstdio>
#include<map>

using namespace std;
typedef pair<int,int> pp;

class UF {
    public:
    int par[300000]={};
    UF(int n) {
        for(int i=0; i<n; i++)
            par[i] = i;
    }
    int find(int x) {
        if(par[x] == x) return x;
        return par[x] = find(par[x]);
    }
    void unite(int x, int y) {
        x = find(x), y = find(y);
        par[x] = y;
    }
};

int main(void) {
    int n,k,l;
    scanf("%d%d%d",&n,&k,&l);
    UF road(250000), rail(250000);
    for(int i=0; i<k; i++) {
        int x,y;
        scanf("%d%d",&x,&y);
        x--, y--;
        road.unite(x,y);
    }
    for(int i=0; i<l; i++) {
        int x,y;
        scanf("%d%d",&x,&y);
        x--, y--;
        rail.unite(x,y);
    }

    map<pp,int> res;
    for(int i=0; i<n; i++)
        res[pp(road.find(i),rail.find(i)]++;

    for(int i=0; i<n; i++) {
        printf("%d%c", res[pp(road.find(i),rail.find(i))], i==n-1 ? '\n' : ' ');
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:15: error: expected primary-expression before '(' token
   43 |         res[pp(road.find(i),rail.find(i)]++;
      |               ^
a.cc:43:41: error: expected ')' before ']' token
   43 |         res[pp(road.find(i),rail.find(i)]++;
      |               ~                         ^
      |                                         )
Language: C++

#include<cstdio>
#include<map>

using namespace std;
typedef pair<int,int> pp;

class UF {
    public:
    int par[300000]={};
    UF(int n) {
        for(int i=0; i<n; i++)
            par[i] = i;
    }
    int find(int x) {
        if(par[x] == x) return x;
        return par[x] = find(par[x]);
    }
    void unite(int x, int y) {
        x = find(x), y = find(y);
        par[x] = y;
    }
};

int main(void) {
    int n,k,l;
    scanf("%d%d%d",&n,&k,&l);
    UF road(250000), rail(250000);
    for(int i=0; i<k; i++) {
        int x,y;
        scanf("%d%d",&x,&y);
        x--, y--;
        road.unite(x,y);
    }
    for(int i=0; i<l; i++) {
        int x,y;
        scanf("%d%d",&x,&y);
        x--, y--;
        rail.unite(x,y);
    }

    map<pp> res;
    for(int i=0; i<n; i++)
        res[pp(road.find(i),rail.find(i)]++;

    for(int i=0; i<n; i++) {
        printf("%d%c", res[pp(road.find(i),rail.find(i))], i==n-1 ? '\n' : ' ');
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:11: error: wrong number of template arguments (1, should be at least 2)
   41 |     map<pp> res;
      |           ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:43:15: error: expected primary-expression before '(' token
   43 |         res[pp(road.find(i),rail.find(i)]++;
      |               ^
a.cc:43:41: error: expected ')' before ']' token
   43 |         res[pp(road.find(i),rail.find(i)]++;
      |               ~                         ^
      |                                         )
a.cc:46:27: error: no match for 'operator[]' (operand types are 'int' and 'pp' {aka 'std::pair<int, int>'})
   46 |         printf("%d%c", res[pp(road.find(i),rail.find(i))], i==n-1 ? '\n' : ' ');
      |                           ^