Who would have missed this question during the competition, and then would have regretted it?
First, the question is very simple, that is, let you remove the minimum number of edges in the graph and make the distance between any two points in the graph an even number.
That is, No Odd Circle exists in the graph.
This is easy to think of a two-part graph. Considering that the data size is small, you can enumerate it now. How can we enumerate it and divide the entire graph enumeration into two parts?
Then remove the edge in the same set. Here, the enumeration uses binary enumeration. 0 represents a set, 1 represents a set, and then traverses all
If the two ends of an edge are in a set, remove them directly and select the smallest
Here we get a lesson & the result of bitwise operation is an integer. to judge the equality, we need to forcibly convert the bool type to obtain bool equality.
(Bool (1 <po [J]. X) & I) = (bool (1 <po [J]. Y) & I ))
# include
# include
# include
using namespace STD; # define maxn 305int n, m; struct point {int X; int y;} po [maxn]; int main () {int t; int I, j, ANS, re_ans; scanf ("% d", & T); While (t --) {scanf ("% d", & N, & M ); for (I = 0; I
re_ans) ans = re_ans;} printf ("% d \ n", ANS);} return 0 ;}