I want to solve this problem by DSU.. But,unfortunately,i don't get that..i have already checked Tutorial,someone else code..but,till now,i'm in darkness It's an Bipartite graph base problem.But,what is happening here ? Anyone plz help me. Thanks in advance