#include<iostream>
#include<cstdio>
#define N 10001
using namespace std;
struct edge{
int to,next;
}e[50001],d[50001];
inline int read(){
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int head[N],n,m,cnt,top,dfn[N],low[N],q[N],scc,h[N],belong[N],hav[N],ans;
bool vis[N],inq[N];
void dfs(int x){
int now,i=head[x];
vi......
阅读全文