#include using namespace std; const int N = 5e5 + 10, M = 4e6 + 10; // 链式前向星 int e[M], h[N], idx, w[M], ne[M]; void add(int a, int b, int c = 0) { e[idx] = b, ne[idx] = h[a], w[idx] = c, h[a] = idx++; } int dfn[N], low[N], ts, root; set _set; void dfs(int u, int fa) { low[u] = dfn[u] = ++ts; int son = 0; for (int i = h[u]; ~i; i = ne[i]) { int v = e[i]; if (v == fa) continue; if (!dfn[v]) { son++; // 儿子数量在割点时有用 dfs(v, u); low[u] = min(low[u], low[v]); // 记录割点 if (u != root && low[v] >= dfn[u]) _set.insert(u); if (u == root && son >= 2) _set.insert(u); } else low[u] = min(low[u], dfn[v]); } } int n, m; int main(void) { scanf("%d %d", &n, &m); // 链式前向星初始化 memset(h, -1, sizeof h); while (m--) { int a, b; scanf("%d %d", &a, &b); add(a, b), add(b, a); } for (root = 1; root <= n; root++) if (!dfn[root]) dfs(root, -1); printf("%d\n", _set.size()); for (auto i : _set) printf("%d ", i); return 0; }