#include using namespace std; int nodeCount,edgeCount; bool vis[1005]; void bfs(int src,vectorG[1005]) { queueq; q.push(src); vis[src]=true; while(!q.empty()) { int u=q.front(); cout<>nodeCount>>edgeCount; memset(vis,false,sizeof(vis)); vector G[1005]; for(int i=1;i<=edgeCount;i++) { int a,b; cin>>a>>b; G[a].push_back(b); } bfs(2,G); }