#P3388. 【模板】割点(割顶)

【模板】割点(割顶)

Description

Given an undirected graph with nn vertices and mm edges, find all articulation points of the graph.

Input Format

The first line contains two positive integers nn and mm. Each of the next mm lines contains two positive integers xx and yy, indicating there is an edge between xx and yy.

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.

6 7
1 2
1 3
1 4
2 5
3 5
4 5
5 6
1 
5

Hint

For all testdata, 1n2×1041\leq n \le 2\times 10^4, 1m1×1051\leq m \le 1 \times 10^5. Vertex indices are greater than 00 and at most nn. The graph is not necessarily connected.

Translated by ChatGPT 5