#pragma comment(linker,"/STACK:102400000,102400000") #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define CL(x,v); memset(x,v,sizeof(x)); #define INF 0x3f3f3f3f #define LL long long #define REP(i,r,n) for(int i=r;i<=n;i++) #define RREP(i,n,r) for(int i=n;i>=r;i--) const int MAXN=2e5+100; int n,m; struct Edge{ int u,v; Edge(){} Edge(int a,int b){ u=a; v=b; } }; vector edges; vector G[MAXN]; vector P[MAXN]; int dfs_clock,bcc_cnt; int pre[MAXN]; int T[MAXN]; int dfs1(int u,int fa) { int lowu=pre[u]=++dfs_clock; for(int i=0;ipre[u]) { P[v].push_back(u); P[u].push_back(v); } } else if(pre[v] GG[MAXN]; int d[MAXN]; void dfs(int u,int dep) { d[u]=dep; for(int i=0;imaxn) { maxn=d[i]; flag=i; } } CL(d,0); dfs(flag,1); maxn=0; for(int i=1;i<=bcc_cnt;i++) { if(d[i]>maxn) maxn=d[i]; } cout<