#716
Friendship Editing
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%
문제
Farmer John's cows are labeled to (). The friendship relationships between the cows can be modeled as an undirected graph with () edges. Two cows are friends if and only if there is an edge between them in the graph.
In one operation, you can add or remove a single edge from the graph. Count the minimum number of operations required to ensure that the following property holds: If cows and are friends, then for every other cow , at least one of and is friends with .
입력
The first line contains and .
The next lines each contain a pair of friends and (). No pair of friends appears more than once.
출력
The number of edges you need to add or remove.
예제 입력 1
3 1
1 2
예제 출력 1
1
예제 입력 2
3 2
1 2
2 3
예제 출력 2
0
예제 입력 3
4 4
1 2
1 3
1 4
2 3
예제 출력 3
1
점수
Inputs 4-13: One input for each in increasing order.Inputs 14-18:
코드 제출
코드를 제출하려면 로그인이 필요합니다.
로그인내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.