Graph Theory37 sections · 1633 units
Open in Course

CSES 1668 Building Teams - Output Format

Print the teams

If bipartition is possible, print nn space-separated integers: the team number (11 or 22) for each pupil from 11 to nn. If impossible, print the single word IMPOSSIBLE. The color array becomes your answer directly. After running bipartite detection successfully, print color[1]+1, color[2]+1, through color[n]+1. Adding 11 converts your internal colors 00 and 11 to team numbers 11 and 22 as required by the output format.