help needed in SPOJ problem BUGLIFE

According to my understanding the [problem][1] basically asks us to check if the graph is bipartite or not.
Here is my

[2] to do so. Can someone please tell me where I am wrong.:)


You’re correct to say the problem is asking you to check whether the graph is bipartite. You might be assuming that the graph is connected, which is neither given nor indeed particularly likely. Otherwise it falls to you to explain your code in more detail; for example, how routine “bfs” works - I don’t see any backtracking to flip colours, for example.

Note that your output of “No Suspicious bugs found!” doesn’t match the capitalization requested.