先放代码。
#include <bits/stdc++.h>
std;
N = , M = ;
head[N], ver[M * ], Next[M * ];
cut[N];
dfn[N], low[N], st[N];
n, m, tot = , num, root, top, cnt;
vector<> dcc[N * ];
{
ver[++tot] = y, Next[tot] = head[x], head[x] = tot;
}
{
dfn[x] = low[x] = ++num;
st[++top] = x;
(x == root && head[x] == ) {
dcc[++cnt].(x);
;
}
flag = ;
( i = head[x]; i; i = Next[i]) {
y = ver[i];
(!dfn[y]) {
(y);
low[x] = (low[x], low[y]);
(low[y] >= dfn[x]) {
flag++;
(x != root || flag > ) cut[x] = ;
cnt++;
z;
{
z = st[top--];
dcc[cnt].(z);
} (z != y);
dcc[cnt].(x);
}
} {
low[x] = (low[x], dfn[y]);
}
}
}
{
ios::();
cin.();
cin >> n >> m;
( i = ; i <= m; i++) {
x, y;
cin >> x >> y;
(x == y) ;
(x, y), (y, x);
}
( i = ; i <= n; i++) {
(!dfn[i]) root = i, (i);
}
cout << cnt << ;
( i = ; i <= cnt; i++) {
cout << dcc[i].();
( j = ; j < dcc[i].(); j++) cout << << dcc[i][j];
cout << ;
}
;
}


