Problem 886 · Medium

Possible Bipartition

Two-colour the dislike graph with BFS; an odd cycle means the split is impossible.

Open the interactive visualisation