Graph Theory37 sections · 1633 units
Open in Course

CSES 1668 Building Teams - Lessons

summary

What did this problem add?

1.1. Output the partition, not yes/no. The color array is the answer.

2.2. Competitive programming I/O: read from stdin, print to stdout.

3.3. Convert colors 00/11 to team labels 11/22 with +1.

4.4. Handle the impossible case explicitly with "IMPOSSIBLE".

Three problems, same algorithm. The framing changes, but the core bipartite detection stays constant. You now have a template that works across platforms.