For this Question: Given a directed graph, detect the presence of a cycle in the graph.The first line of input contains two integers N and M which denotes the no of vertices and no of edges in the graph respectively. 
Next M lines contain space-separated integers u and v denoting that there is a directed edge from u to v.

Constraints:
1 <= N, M <= 1000
0 <= u, v <=  N-1, u != v
There are no self loops or multiple edges.The method should return 1 if there is a cycle else it should return 0.Sample Input 1:
4 5
0 1
1 2
2 3
3 0
0 2

Sample Output 1:
Yes

Explanation:
There is a cycle with nodes 0, 1, 2, 3

Sample Input 2:
4 4
0 1
1 2
2 3
0 3

Sample Output 2:
No

Explanation:
There is no cycle in this graph, I have written this Solution Code: #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

vector<int> g[N];
int vis[N];
bool flag = 0;

void dfs(int u){
	vis[u] = 1;
	for(auto i: g[u]){
		if(vis[i] == 1)
			flag = 1;
		if(vis[i] == 0)	dfs(i);
	}
	vis[u] = 2;
}

signed main() {
	IOS;
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= m; i++){
		int u, v;
		cin >> u >> v;
		g[u].push_back(v);
	}	
	for(int i = 0; i < n; i++){
		if(vis[i])	continue;
		dfs(i);
	}
	if(flag)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?