Problem Link: https://usaco.guide/silver/dfs#problem-apio-11-TableColoring
Solution: https://usaco.guide/problems/apio-2011table-coloring/solution
As written in solution this problem can be solved either using DFS or DSU. Since I’m learning DFS (Two - Coloring) in USACO Guide so I would like to solve it using DFS Two-coloring.
I’ve tried to implement it but it failed and got WA on most test cases.