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>
using namespace std;

#define pb         push_back
#define mp         make_pair
#define ll         long long
#define PI         acos(-1.0)
#define ALL(A)     ((A).begin(), (A).end())
#define vsort(v)   sort(v.begin(),v.end())
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

#define MAX 100005;
#define NIL -1;

struct Node{int p, l, r; };

Node T[MAX];
int n, D[MAX];

void print(int u){
    int i, c;
    cout << "node" << u << ": ";
    cout << "parant = " << T[u].p << ", ";
    cout NN "depth = " << D[u] << ", ";

    if(T[u].p == NIL) cout << "root, ";
    else if(T[u] == NIL) cout << "leaf, ";
    else cout << "internal node, ";

    cout << "[";

    for(i=0, c=T[u].l; c!=NIL; i++, c=T[c].r){
        if(i) cout << ", ";
        cout << c;
    }
    cout << "]" << endl;
}

int rec(int u, int p){
    D[u] = p;
    if(T[u].r != NIL) rec(T[u].r, p);
    if(t[u].l != NIL) rec(T[u].l, p+1);
}

int main(){
    int d, v, c, l, r;
    cin >> n;
    FOR(i, 0, n) T[i].p = T[i].l = T[i].r = NIL;

    FOR(i, 0, n){
        cin >> v >> d;
        FOR(j, 0, d){
            cin >> c;
            if(j==0) T[v].l = c;
            else T[l].r = c;
            l = c;
            T[c].p = v;
        }
    }
    FOR(i, 0, n){
        if(T[i].p==NIL) r = i;
    }

    rec(r, 0);

    FOR(i, 0, n) print(i);
}

Compiler output:
a.cc:24:19: error: expected ']' before ';' token
   24 | #define MAX 100005;
      |                   ^
a.cc:29:8: note: in expansion of macro 'MAX'
   29 | Node T[MAX];
      |        ^~~
a.cc:29:11: error: expected unqualified-id before ']' token
   29 | Node T[MAX];
      |           ^
a.cc:24:19: error: expected ']' before ';' token
   24 | #define MAX 100005;
      |                   ^
a.cc:30:10: note: in expansion of macro 'MAX'
   30 | int n, D[MAX];
      |          ^~~
a.cc:30:13: error: expected unqualified-id before ']' token
   30 | int n, D[MAX];
      |             ^
a.cc: In function 'void print(int)':
a.cc:35:28: error: 'T' was not declared in this scope
   35 |     cout << "parant = " << T[u].p << ", ";
      |                            ^
a.cc:36:9: error: expected ';' before 'NN'
   36 |     cout NN "depth = " << D[u] << ", ";
      |         ^~~
      |         ;
a.cc:38:21: error: expected primary-expression before ')' token
   38 |     if(T[u].p == NIL) cout << "root, ";
      |                     ^
a.cc:39:24: error: expected primary-expression before ')' token
   39 |     else if(T[u] == NIL) cout << "leaf, ";
      |                        ^
a.cc:44:30: error: expected primary-expression before ';' token
   44 |     for(i=0, c=T[u].l; c!=NIL; i++, c=T[c].r){
      |                              ^
a.cc:44:30: error: expected ')' before ';' token
   44 |     for(i=0, c=T[u].l; c!=NIL; i++, c=T[c].r){
      |        ~                     ^
a.cc: In function 'int rec(int, int)':
a.cc:52:5: error: 'D' was not declared in this scope
   52 |     D[u] = p;
      |     ^
a.cc:53:8: error: 'T' was not declared in this scope
   53 |     if(T[u].r != NIL) rec(T[u].r, p);
      |        ^
a.cc:53:21: error: expected primary-expression before ')' token
   53 |     if(T[u].r != NIL) rec(T[u].r, p);
      |                     ^
a.cc:54:8: error: 't' was not declared in this scope
   54 |     if(t[u].l != NIL) rec(T[u].l, p+1);
      |        ^
a.cc:54:21: error: expected primary-expression before ')' token
   54 |     if(t[u].l != NIL) rec(T[u].l, p+1);
      |                     ^
a.cc:54:27: error: 'T' was not declared in this scope
   54 |     if(t[u].l != NIL) rec(T[u].l, p+1);
      |                           ^
a.cc:55:1: warning: no return statement in function returning non-void [-Wreturn-type]
   55 | }
      | ^
a.cc: In function 'int main()':
a.cc:60:18: error: 'T' was not declared in this scope
   60 |     FOR(i, 0, n) T[i].p = T[i].l = T[i].r = NIL;
      |                  ^
a.cc:66:22: error: 'T' was not declared in this scope
   66 |             if(j==0) T[v].l = c;
      |                      ^
a.cc:67:18: error: 'T' was not declared in this scope
   67 |             else T[l].r = c;
      |                  ^
a.cc:69:13: error: 'T' was not declared in this scope
   69 |             T[c].p = v;
      |             ^
a.cc:73:12: error: 'T' was not declared in this scope
   73 |         if(T[i].p==NIL) r = i;
      |            ^
a.cc:73:23: error: expected primary-expression before ')' token
   73 |         if(T[i].p==NIL) r = i;
      |                       ^