Problem 886 · Medium
Two-colour the dislike graph with BFS; an odd cycle means the split is impossible.
Open the interactive visualisation