alu_mathics:
Your last I/O is correct, and the last I/O let me find the last mistake in my program! After almost two weeks work, this problem is solved finally.
Thank to all that post reply to this topic!
alu_mathics:
Can you tell me what's wrong you have made? I had test all data above, they are all ok, but I still got W.A. Maybe I have made the same mistake with you.
My algo is: read pair(x,y) 1.if neither of x and y is labeled person+2;(person is the number of person that I have visited) group++;(group is the number of groups) label x and y with group; 2.if one of them is labeled and another isn't person++; make them label the same 3.if both of them are ...
void Judge(long int rel[2],long int group[50001],long int rels[50001][2],long int *p,long int *g,long int *r) { if (group[rel[0]]==0&&group[rel[1]]==0) { (*p ...