I am getting wrong answer for following question.
Sereja has undirected graph, which consists of n vertexes and m edges. Sereja can delete edges from the graph. Now Sereja is interested in one question : is it possible to delete edges in the graph so that the degree of each vertex in the graph will be equal 1?
Please, help Sereja.
Approach:: we have to check whether there is perfect matching or not. i have solved it using tutte’s matrix calculate determinant of matrix using gauusian elimination if determinant is greater then 0 then then print YES otherwise NO.
Code link here
please tell me if i am doing something wrong.