[BOJ 14060] Paths in Multigraph

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given is an undirected multigraph G without loops.</p>

Write a program disconnect, which determines the minimum number of edges that must be removed from G, so that the resulting multigraph to be disconnected.

입력 형식

The first line of the standard input contains an integer n – the number of vertices in G. The vertices of the multigraph G are numbered from 1 to n. The second line of the standard input contains an integer m – the number of edges in G. The next m lines of the standard input contain the endpoints u and v of the consecutive edge in multigraph G.

출력 형식

The only line of the standard output has to contain one integer – the minimum number of edges that must be removed from G, so that the resulting multigraph to be disconnected.

예제 입력 1

2
3
1 2
1 2
1 2

예제 출력 1

3

예제 입력 2

3
2
1 2
2 3

예제 출력 2

1

예제 입력 3

3
1
1 2

예제 출력 3

0

Comments

There are no comments at the moment.