Once you see it, this problem is bipartite detection in disguise. Build a graph: nodes (people), add an edge for each dislike pair. Then check if the graph is bipartite. If bipartite, you can put one partition in room A and the other in room B.
All dislikes cross between rooms. If not bipartite, there is an odd cycle of dislikes. You cannot satisfy everyone. Some pair of enemies must end up together.