Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

原来是搞错了这题的逻辑

Posted by schindlerlee at 2008-08-10 10:51:14 on Problem 1703
我就觉得照搬2492的程序怎么还会出错
原来我认为是两个人有一个任何以没有对立的人时
输出not sure,其他的进行判断
原来时两人祖先相等时输出same,和对立相等时输出different
其他输出not sure
逻辑时这样的才对

fa=find_set(a);
fb=find_set(b);
if(fa==fb)
        printf("In the same gang.\n");
else if(fa==find_set(opp[fb]))
	printf("In different gangs.\n");
else
	printf("Not sure yet.\n");

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator