Want small test case when my logic fails for "Bear and Different Names(codeforces)" problem?

Revision en1, by codeDominus, 2017-03-22 16:38:19

link to problem

I solved the problem using DSU; My logic: let suppose there is two disjoint set of size M and N where each member is a friend of every other in the set. now suppose one member of 1st set become friend of a member of 2nd set. we need total of m*n such friendship for every member of 1st set to become friends with every other member of 2nd set.

is there any mistake in my logic ?(posting me solution just for logic not for debugging)

my solution

thanks in advance

Tags dsu

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English codeDominus 2017-03-22 16:38:52 27
en1 English codeDominus 2017-03-22 16:38:19 693 Initial revision (published)