Here is my code can anybody detect any error in my code …please tell me…it tells no suspicious bug found in every time
#include <bits/stdc++.h>
using namespace std;
vector ar[1000001];
int vis[1000001];
int col[1000001];
bool dfs(int pos, int c)
{
vis[pos] = 1;
col[pos] = c;
for (int child : ar[pos])
{
if (vis[child] == 0) {
bool xy = dfs(child, c ^ 1);
if (xy == false)
return false;
}
else if (col[child] == col[pos]) {
return false;
}
}
}
signed main()
{
ios::sync_with_stdio(0);
cout.tie(0);
int t, n, e, a, b, dd = 1;
cin >> t;
while (t–) {
cin >> n >> e;
int xx = e;
for (int i = 1; i <= n; i++)
ar[i].clear(), vis[i] = 0, col[i] = 0;
while (xx–)
{
cin >> a >> b;
cin.tie(0);
ar[a].push_back(b);
ar[b].push_back(a);
} bool flag = true;
for (int i = 1; i <= n; i++)
{
if ( vis[i] = 0)
{
bool ff = dfs(i, 0);
if (ff == false)
flag = false;
}
}
cout << “Scenario #” << dd << “:” << “\n”; dd++;
//cout << e << n;
if (flag == true )
cout << “No suspicious bugs found!” << “\n”;
else
cout << “Suspicious bugs found!” << “\n”;
}
}