Language: C

#include<stdio.h>

int G[101][102];
int found[101];
int comp[101];   // complete.
int t;  // time.

typedef struct box{ int val; box* next; } box_t;  // stack.

box_t* init()
{
    box_t* head = new box_t;
    head->val = -1;
    head->next = NULL;
    return head;
}

bool isEmpty(box_t* head){ return (head->next == NULL ? true : false); }

box_t* push(box_t* head, int data)
{
    box_t* box = new box_t;
    box->val = data;
    box->next = head->next;
    head->next = box;
    return box;
}

int pop(box_t* head)
{
    if(isEmpty(head)){ return -1; }
    box_t* box = head->next;
    int val;
    head->next = box->next;
    val = box->val;
    delete box;
    return val;
}

int front(box_t* head)
{
    int val;
    if(isEmpty(head)){ return -1; }
    val = head->next->val;
    return val;
}

box_t* stack = init();

void search_loop(int i)
{
    int j, k;
    while(1){
        if(found[i] == 0){
            t++; found[i] = t;
            push(stack, i);
        }
        for(k = G[i][0]; G[i][k] != 0 && found[G[i][k]] != 0; k++);
        if(G[i][k] == 0){
            if(isEmpty(stack)){ return; }
            else{
                j = pop(stack);
                t++; comp[j] = t;
                i = front(stack);
            }
        }else{
            G[i][0] = k + 1;
            i = G[i][k];
        }
    };
    return;
}

int main()
{
    int n, i, j, a, b, e;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        G[i][0] = 1;
        for(j = 1; j <= n + 1; j++){ G[i][j] = 0; } }

    for(i = 1; i <= n; i++){
        scanf("%d %d", &a, &e);
        for(j = 1; j <= e; j++){
            scanf("%d", &b); G[a][j] = b; } }  // adjacent representation.

    for(i = 1; i <= n; i++){ found[i] = 0; comp[i] = 0; }
    t = 0;
    while(1){
        for(i = 1; i <= n; i++){
            if(found[i] == 0) break;
        }
        if(i > n) break;
        search_loop(i);
    };

    for(i = 1; i <= n; i++){
        printf("%d %d %d\n", i, found[i], comp[i]);
    }
    return 0;
}

Compiler output:
main.c:8:30: error: unknown type name 'box'
    8 | typedef struct box{ int val; box* next; } box_t;  // stack.
      |                              ^~~
main.c: In function 'init':
main.c:12:19: error: 'new' undeclared (first use in this function)
   12 |     box_t* head = new box_t;
      |                   ^~~
main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:23: error: expected ',' or ';' before 'box_t'
   12 |     box_t* head = new box_t;
      |                       ^~~~~
main.c: At top level:
main.c:18:1: error: unknown type name 'bool'
   18 | bool isEmpty(box_t* head){ return (head->next == NULL ? true : false); }
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'isEmpty':
main.c:18:57: error: 'true' undeclared (first use in this function)
   18 | bool isEmpty(box_t* head){ return (head->next == NULL ? true : false); }
      |                                                         ^~~~
main.c:18:57: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:18:64: error: 'false' undeclared (first use in this function)
   18 | bool isEmpty(box_t* head){ return (head->next == NULL ? true : false); }
      |                                                                ^~~~~
main.c:18:64: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'push':
main.c:22:18: error: 'new' undeclared (first use in this function)
   22 |     box_t* box = new box_t;
      |                  ^~~
main.c:22:22: error: expected ',' or ';' before 'box_t'
   22 |     box_t* box = new box_t;
      |                      ^~~~~
main.c:25:16: error: assignment to 'int *' from incompatible pointer type 'box_t *' {aka 'struct box *'} [-Wincompatible-pointer-types]
   25 |     head->next = box;
      |                ^
main.c: In function 'pop':
main.c:32:18: error: initialization of 'box_t *' {aka 'struct box *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   32 |     box_t* box = head->next;
      |                  ^~~~
main.c:36:5: error: unknown type name 'delete'
   36 |     delete box;
      |     ^~~~~~
main.c:36:12: error: conflicting types for 'box'; have 'int'
   36 |     delete box;
      |            ^~~
main.c:32:12: note: previous definition of 'box' with type 'box_t *' {aka 'struct box *'}
   32 |     box_t* box = head->next;
      |            ^~~
main.c: In function 'front':
main.c:44:21: error: request for member 'val' in something not a structure or union
   44 |     val = head->next->val;
      |                     ^~
main.c: At top level:
main.c:48:16: error: initializer element is not constant
   48 | box_t* stack = init();
      |                ^~~~