Language: C++

int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
int top,scc,cnt;
void tarjan_dfs(int cur)
{
    dfn[cur] = low[cur] = ++cnt;
    st[++top] = cur;
    instack[cur] = 1;
    for(int i = g[cur]; i ;i = edge[i].nxt){
        int v = edge[i].v;
        if( !instack[v] ){
            tarjan_dfs(v);
            low[cur] = min(low[cur],low[v]);
        }
        else if( instack[v] == 1 )
            low[cur] = min(low[cur],dfn[v]);
    }
    if( low[cur] == dfn[cur] ){
        ++scc;
        for(;;){
            int tmp = st[top];
            top--;
            cor[tmp] = scc;
            cor_tot[scc]++;
            instack[tmp] = 2;
            if( tmp == cur )
                break;
        }
    }
}
void tarjan()
{
    memset(instack,0,sizeof(instack));
    memset(cor_tot,0,sizeof(cor_tot));
    scc = cnt = 0;
    top = 0;
    for(int i = 1;i <= n;i++)
        if( !instack[i] )
            tarjan_dfs(i);
}

Compiler output:
a.cc:1:9: error: 'nMax' was not declared in this scope
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
      |         ^~~~
a.cc:1:19: error: 'nMax' was not declared in this scope
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
      |                   ^~~~
a.cc:1:29: error: 'nMax' was not declared in this scope
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
      |                             ^~~~
a.cc:1:43: error: 'nMax' was not declared in this scope
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
      |                                           ^~~~
a.cc:1:52: error: 'nMax' was not declared in this scope
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
      |                                                    ^~~~
a.cc: In function 'void tarjan_dfs(int)':
a.cc:5:5: error: 'dfn' was not declared in this scope
    5 |     dfn[cur] = low[cur] = ++cnt;
      |     ^~~
a.cc:5:16: error: 'low' was not declared in this scope
    5 |     dfn[cur] = low[cur] = ++cnt;
      |                ^~~
a.cc:6:5: error: 'st' was not declared in this scope; did you mean 'std'?
    6 |     st[++top] = cur;
      |     ^~
      |     std
a.cc:7:5: error: 'instack' was not declared in this scope
    7 |     instack[cur] = 1;
      |     ^~~~~~~
a.cc:8:17: error: 'g' was not declared in this scope
    8 |     for(int i = g[cur]; i ;i = edge[i].nxt){
      |                 ^
a.cc:8:32: error: 'edge' was not declared in this scope
    8 |     for(int i = g[cur]; i ;i = edge[i].nxt){
      |                                ^~~~
a.cc:12:24: error: 'min' was not declared in this scope
   12 |             low[cur] = min(low[cur],low[v]);
      |                        ^~~
a.cc:15:24: error: 'min' was not declared in this scope
   15 |             low[cur] = min(low[cur],dfn[v]);
      |                        ^~~
a.cc:22:13: error: 'cor' was not declared in this scope; did you mean 'cur'?
   22 |             cor[tmp] = scc;
      |             ^~~
      |             cur
a.cc:23:13: error: 'cor_tot' was not declared in this scope
   23 |             cor_tot[scc]++;
      |             ^~~~~~~
a.cc: In function 'void tarjan()':
a.cc:32:12: error: 'instack' was not declared in this scope
   32 |     memset(instack,0,sizeof(instack));
      |            ^~~~~~~
a.cc:32:5: error: 'memset' was not declared in this scope
   32 |     memset(instack,0,sizeof(instack));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int cor[nMax],dfn[nMax],low[nMax],instack[nMax],st[nMax];
a.cc:33:12: error: 'cor_tot' was not declared in this scope
   33 |     memset(cor_tot,0,sizeof(cor_tot));
      |            ^~~~~~~
a.cc:36:24: error: 'n' was not declared in this scope
   36 |     for(int i = 1;i <= n;i++)
      |                        ^