#K68582. Identifying Critical Servers in a Network

    ID: 32896 Type: Default 1000ms 256MiB

Identifying Critical Servers in a Network

Identifying Critical Servers in a Network

You are given a network of n servers (numbered from 0 to n-1) and a list of bidirectional links between them. A server is considered critical if its removal increases the number of connected components of the network.

Formally, for an undirected graph \(G=(V, E)\), a vertex \(v \in V\) is an articulation point if and only if removing \(v\) (and all the edges incident to \(v\)) increases the number of connected components in \(G\).

Your task is to identify all the critical servers and print them in increasing order. If there are no critical servers, print an empty line.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer (n), representing the number of servers.
  • The second line contains an integer (m), representing the number of links.
  • Each of the next (m) lines contains two integers (u) and (v), denoting a bidirectional link between server (u) and server (v).

outputFormat

Print the list of critical servers (articulation points) in increasing order, separated by a single space, on one line. If there are no critical servers, output an empty line.## sample

6
6
0 1
0 2
1 2
1 3
3 4
4 5
1 3 4