Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define NUM 200010

unsigned int n, k, l;
unsigned int road[NUM][2];
unsigned int rail[NUM][2];

unsigned int check[NUM];
unsigned int passed[NUM];
unsigned int station[NUM];
unsigned int ans[NUM];

unsigned int road_category[NUM];
unsigned int rail_category[NUM];

// typedef struct node {
//     int rank;
//     int value;
//     node* next = NULL;
// } node;

// unsigned int union_road[NUM];
unsigned int par_road[NUM];
unsigned int rank_road[NUM];
unsigned int count_road[NUM];
// unsigned int union_rail[NUM];
unsigned int par_rail[NUM];
unsigned int rank_rail[NUM];
unsigned int count_rail[NUM];

// void connected_road(unsigned int index){
//     unsigned int i, j, h;
//     for(i=1;i<=n;i++) {
//         check[i]=0;
//         passed[i]=0;
//     }
//     unsigned int flag = 0;
//     check[index] = 1;
//     do{
//         flag = 0;
//         for(j=1;j<=n;j++) {
//             if(check[j] == 1){
//                 for(i=1;i<=k;i++) {
//                     if(road[i][0] == j && passed[road[i][1]] != 1) {
//                         check[road[i][1]] = 1;
//                     }
//                     else if(road[i][1] == j && passed[road[i][0]] != 1) {
//                         check[road[i][0]] = 1;
//                     }
//                 }
//                 passed[j] = 1;
//                 check[j] = 0;
//                 flag = 1;
//             }
//         }
//     } while(flag);
    
//     return;
// }

// void connected_rail(unsigned int index){
//     unsigned int i, j, h;
//     for(i=1;i<=n;i++) {
//         check[i]=0;
//         station[i]=0;
//     }
//     unsigned int flag = 0;
//     check[index] = 1;
//     do{
//         flag = 0;
//         for(j=1;j<=n;j++) {
//             if(check[j] == 1){
//                 for(i=1;i<=l;i++) {
//                     if(rail[i][0] == j && station[rail[i][1]] != 1) {
//                         check[rail[i][1]] = 1;
//                     }
//                     else if(rail[i][1] == j && station[rail[i][0]] != 1) {
//                         check[rail[i][0]] = 1;
//                     }
//                 }
//                 station[j] = 1;
//                 check[j] = 0;
//                 flag = 1;
//             }
//         }
//     } while(flag);
    
//     return;
// }

// void categorize_city(){
//     int i, j;
//     for(i=1; i<=n; i++) {
//         road_category[i] = 0;
//         rail_category[i] = 0;
//     }
//     for(i=1; i<=n; i++) {
//         if(road_category[i] == 0){
//             connected_road(i);
//             for(j=1; j<=n; j++) {
//               if(passed[j] == 1){
//                   road_category[j] = i;
//               }
//             }
//         }
//         if(rail_category[i] == 0){
//             connected_rail(i);
//             for(j=1; j<=n; j++) {
//               if(station[j] == 1){
//                   rail_category[j] = i;
//               }
//             }
//         }
        
//     }
// }

unsigned int root(unsigned int x, unsigned int* par, unsigned int* rank) {
    return par[x]==x ? x : (par[x]=root(par[x], par, rank));
}

// bool same(unsigned int x, unsigned int y, unsigned int* par, unsigned int* rank) {
//     return root(x, par, rank) == root(y, par, rank);
// }

void unite(unsigned int x, unsigned int y, unsigned int* par, unsigned int* rank) {
    x = root(x, par, rank);
    y = root(y, par, rank);
    if (x == y) return;
    
    if(rank[x] < rank[y]) {
        par[x] = y;
        count[y] = count[x] + count[y] + 1;
    } else {
        par[y] = x;
        count[x] = count[y] + count[x] + 1;
        if (rank[x] == rank[y]) rank[x]++;
    }
}



int main(){
    unsigned int i, j;
    unsigned int terminal_road, terminal_rail;
    scanf("%d%d%d", &n, &k, &l);
    //prunsigned intf("%d %d %d\n", n, k, l);
    
    
    for(i=0; i<NUM; i++) {
        par_road[i] = i;
        rank_road[i] = 0;
        count_road[i] = 0;
        par_rail[i] = i;
        rank_rail[i] = 0;
        count_rail[i] = 0;
    }
    
    for(i=1; i<=k; i++) {
        scanf("%d%d", &road[i][0], &road[i][1]);
        int c1 = road[i][0];
        int c2 = road[i][1];
        unite(c1, c2, par_road, rank_road);
    }
    for(i=1; i<=l; i++) {
        scanf("%d%d", &rail[i][0], &rail[i][1]);
        int c1 = rail[i][0];
        int c2 = rail[i][1];
        unite(c1, c2, par_rail, rank_rail);
    }
    
    // categorize_city();
    

    
    return 0;
}


Compiler output:
main.c: In function 'unite':
main.c:136:9: error: 'count' undeclared (first use in this function)
  136 |         count[y] = count[x] + count[y] + 1;
      |         ^~~~~
main.c:136:9: note: each undeclared identifier is reported only once for each function it appears in