P3388 [Template] Articulation Points (Cut Vertices)

Background

Articulation points.

Description

Given an undirected graph with $n$ vertices and $m$ edges, find all articulation points of the graph.

Input Format

The first line contains two positive integers $n$ and $m$. Each of the next $m$ lines contains two positive integers $x$ and $y$, indicating there is an edge between $x$ and $y$.

Output Format

On the first line, output the number of articulation points. On the second line, output the vertices in increasing order of their indices, separated by spaces.

Explanation/Hint

For all testdata, $1\leq n \le 2\times 10^4$, $1\leq m \le 1 \times 10^5$. Vertex indices are greater than $0$ and at most $n$. The graph is not necessarily connected. Translated by ChatGPT 5