Language: C++

void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
{
    vis[s]=true;
    c++;
    max_c=max(max_c,c);
    for(auto x:adj[s])
    {
        if(!vis[x])
        {
            util(adj,x,c,max_c,vis);
            vis[x]=false;
            c--;
        }
    }
    vis[s]=false;
    c--;
    return;
}
int main() {
	// your code goes here
	int n,m;
	cin>>n>>m;
	vector<int> adj[n];
	int a,b;
	for(int i=0;i<m;i++)
	{
	    cin>>a>>b;
	    adj[a-1].push_back(b-1);
	}
	vector<bool> vis(n,0);
	int max_c=0;
	int c=0;
	for(int i=0;i<n;i++)
	{
	    c=0;
	    if(!vis[i])
	    {
	        util(adj,i,c,max_c,vis);
	    }
	}
	cout<<max_c<<endl;
	return 0;
}


Compiler output:
a.cc:1:6: error: variable or field 'util' declared void
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |      ^~~~
a.cc:1:11: error: 'vector' was not declared in this scope
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |           ^~~~~~
a.cc:1:18: error: expected primary-expression before 'int'
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                  ^~~
a.cc:1:29: error: expected primary-expression before 'int'
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                             ^~~
a.cc:1:35: error: expected primary-expression before 'int'
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                                   ^~~
a.cc:1:42: error: expected primary-expression before 'int'
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                                          ^~~
a.cc:1:53: error: 'vector' was not declared in this scope
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                                                     ^~~~~~
a.cc:1:60: error: expected primary-expression before 'bool'
    1 | void util(vector<int> adj[],int s,int& c,int& max_c,vector<bool>&vis)
      |                                                            ^~~~
a.cc: In function 'int main()':
a.cc:22:9: error: 'cin' was not declared in this scope
   22 |         cin>>n>>m;
      |         ^~~
a.cc:23:9: error: 'vector' was not declared in this scope
   23 |         vector<int> adj[n];
      |         ^~~~~~
a.cc:23:16: error: expected primary-expression before 'int'
   23 |         vector<int> adj[n];
      |                ^~~
a.cc:28:13: error: 'adj' was not declared in this scope
   28 |             adj[a-1].push_back(b-1);
      |             ^~~
a.cc:30:16: error: expected primary-expression before 'bool'
   30 |         vector<bool> vis(n,0);
      |                ^~~~
a.cc:36:17: error: 'vis' was not declared in this scope
   36 |             if(!vis[i])
      |                 ^~~
a.cc:38:22: error: 'adj' was not declared in this scope
   38 |                 util(adj,i,c,max_c,vis);
      |                      ^~~
a.cc:38:17: error: 'util' was not declared in this scope
   38 |                 util(adj,i,c,max_c,vis);
      |                 ^~~~
a.cc:41:9: error: 'cout' was not declared in this scope
   41 |         cout<<max_c<<endl;
      |         ^~~~
a.cc:41:22: error: 'endl' was not declared in this scope
   41 |         cout<<max_c<<endl;
      |                      ^~~~