Language: C++

namespace Sccs{
    typedef vector<vector<int>> Graph;
    //O(V+E)
    class Scc{
    private:
        int N;Graph g,rg;
        vector<int> vs;vector<bool> used;       
        void dfs(int v){
            used[v]=true;
            for(int to:g[v])if(!used[to])dfs(to);
            vs.push_back(v);
        }
        void rdfs(int v,int k){
            used[v]=true;cmp[v]=k;
            for(int to:rg[v])if(!used[to])rdfs(to,k);
        }
    public:
        vector<int> cmp;//cmp...強連結成分を同一視したトポロジカルソート順序
        Scc(int N):N(N){
            g=rg=Graph(N);
            vs=cmp=vector<int>(N);used=vector<bool>(N);
        }
        void add_edge(int f,int t){
            g[f].push_back(t);rg[t].push_back(f);
        }
        int scc(){
            vs.clear();
            fill(ALL(used),false);
            REP(v,N)if(!used[v])dfs(v);
            fill(ALL(used),false);
            int k=0;REPr(v,N)if(!used[vs[v]])rdfs(vs[v],k++);
            return k;
        }
        bool same(int i,int j){return cmp[i]==cmp[j];}
        bool has_cycle(){
            //self loop
            REP(v,N)for(int to:g[v])if(to==v)return true;
            //cycle
            REP(i,N)REP(j,N)if(i!=j && same(i,j))return true;
            return false;
        }
    };
}
using namespace Sccs;

Compiler output:
a.cc:2:13: error: 'vector' does not name a type
    2 |     typedef vector<vector<int>> Graph;
      |             ^~~~~~
a.cc:6:15: error: 'Graph' does not name a type
    6 |         int N;Graph g,rg;
      |               ^~~~~
a.cc:7:9: error: 'vector' does not name a type
    7 |         vector<int> vs;vector<bool> used;
      |         ^~~~~~
a.cc:7:24: error: 'vector' does not name a type
    7 |         vector<int> vs;vector<bool> used;
      |                        ^~~~~~
a.cc:18:9: error: 'vector' does not name a type
   18 |         vector<int> cmp;//cmp...強連結成分を同一視したトポロジカルソート順序
      |         ^~~~~~
a.cc: In member function 'void Sccs::Scc::dfs(int)':
a.cc:9:13: error: 'used' was not declared in this scope
    9 |             used[v]=true;
      |             ^~~~
a.cc:10:24: error: 'g' was not declared in this scope
   10 |             for(int to:g[v])if(!used[to])dfs(to);
      |                        ^
a.cc:11:13: error: 'vs' was not declared in this scope; did you mean 'v'?
   11 |             vs.push_back(v);
      |             ^~
      |             v
a.cc: In member function 'void Sccs::Scc::rdfs(int, int)':
a.cc:14:13: error: 'used' was not declared in this scope
   14 |             used[v]=true;cmp[v]=k;
      |             ^~~~
a.cc:14:26: error: 'cmp' was not declared in this scope
   14 |             used[v]=true;cmp[v]=k;
      |                          ^~~
a.cc:15:24: error: 'rg' was not declared in this scope
   15 |             for(int to:rg[v])if(!used[to])rdfs(to,k);
      |                        ^~
a.cc: In constructor 'Sccs::Scc::Scc(int)':
a.cc:20:13: error: 'g' was not declared in this scope
   20 |             g=rg=Graph(N);
      |             ^
a.cc:20:15: error: 'rg' was not declared in this scope
   20 |             g=rg=Graph(N);
      |               ^~
a.cc:20:18: error: 'Graph' was not declared in this scope
   20 |             g=rg=Graph(N);
      |                  ^~~~~
a.cc:21:13: error: 'vs' was not declared in this scope
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |             ^~
a.cc:21:16: error: 'cmp' was not declared in this scope
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |                ^~~
a.cc:21:20: error: 'vector' was not declared in this scope
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |                    ^~~~~~
a.cc:21:27: error: expected primary-expression before 'int'
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |                           ^~~
a.cc:21:35: error: 'used' was not declared in this scope
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |                                   ^~~~
a.cc:21:47: error: expected primary-expression before 'bool'
   21 |             vs=cmp=vector<int>(N);used=vector<bool>(N);
      |                                               ^~~~
a.cc: In member function 'void Sccs::Scc::add_edge(int, int)':
a.cc:24:13: error: 'g' was not declared in this scope
   24 |             g[f].push_back(t);rg[t].push_back(f);
      |             ^
a.cc:24:31: error: 'rg' was not declared in this scope
   24 |             g[f].push_back(t);rg[t].push_back(f);
      |                               ^~
a.cc: In member function 'int Sccs::Scc::scc()':
a.cc:27:13: error: 'vs' was not declared in this scope
   27 |             vs.clear();
      |             ^~
a.cc:28:22: error: 'used' was not declared in this scope
   28 |             fill(ALL(used),false);
      |                      ^~~~
a.cc:28:18: error: 'ALL' was not declared in this scope
   28 |             fill(ALL(used),false);
      |                  ^~~
a.cc:28:13: error: 'fill' was not declared in this scope
   28 |             fill(ALL(used),false);
      |             ^~~~
a.cc:29:17: error: 'v' was not declared in this scope
   29 |             REP(v,N)if(!used[v])dfs(v);
      |                 ^
a.cc:29:13: error: 'REP' was not declared in this scope
   29 |             REP(v,N)if(!used[v])dfs(v);
      |             ^~~
a.cc:31:21: error: 'REPr' was not declared in this scope
   31 |             int k=0;REPr(v,N)if(!used[vs[v]])rdfs(vs[v],k++);
      |                     ^~~~
a.cc: In member function 'bool Sccs::Scc::same(int, int)':
a.cc:34:39: error: 'cmp' was not declared in this scope
   34 |         bool same(int i,int j){return cmp[i]==cmp[j];}
      |                                       ^~~
a.cc: In member function 'bool Sccs::Scc::has_cycle()':
a.cc:37:17: error: 'v' was not declared in this scope
   37 |             REP(v,N)for(int to:g[v])if(to==v)return true;
      |                 ^
a.cc:37:13: error: 'REP' was not declared in this scope
   37 |             REP(v,N)for(int to:g[v])if(to==v)return true;
      |             ^~~
a.cc:39:17: error: 'i' was not declared in this scope
   39 |             REP(i,N)REP(j,N)if(i!=j && same(i,j))return true;
      |                 ^