Here is the link to the problem and here is the link to my solution. I am using a disjoint set data structure to store 2 kinds of elements x and !x. If x and y are in the same set then they have the same type. If !x and y are in same set then x can eat y. I keep getting WA. Does anybody has any idea about this?
can you describe the logic behind this solution....