Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:MLE和TLE的看看是不是因为这个....In Reply To:MLE和TLE的看看是不是因为这个.... Posted by:zzyzzy12 at 2012-02-13 11:08:35 > 大家很多都是并查集~~用father[]可以不断指向集合标志数...用另外一个数组s[]可以指向这个集合所相对的那个集合标志数.. > 大家在D x y时判断合并x,y的集合时..一定要注意.. > 不仅 x=getfahter(x); y=getfather(y); > 同样 s[x]=getfather(s[x]); s[y]=getfather(y) > 我就是因为s[]没有做对~~就MLE了好久..我是用递归写的getfather..若使用迭代..没更新s[]会TLE.... Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator