#include #include #include #include #include using namespace std; #define MAXN 100010 int pre[MAXN],vis[MAXN],low[MAXN]; vector e[MAXN]; int bfs1(int st,int et){ queue q; q.push(st); vis[st]=1;pre[st]=-1; while(!q.empty()){ int now=q.front(); q.pop(); for(int i=e[now].size()-1;i>=0;i--){ int next=e[now][i]; if(vis[next])continue; vis[next]=1; pre[next]=now; if(next==et)return 1; q.push(next); } } return 0; } int bfs2(int u){ queue q; q.push(u); int res=u; vis[u]=1; while(!q.empty()){ int now=q.front(); q.pop(); for(int i=e[now].size()-1;i>=0;i--){ int next=e[now][i]; if(vis[next])continue; vis[next]=1; if(low[next]==0)q.push(next); else if(low[next]