| ||||||||||
| 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 | |||||||||
粗心的代价int find(int x)
{
if(fa[x]==x) return x;
int tx=find(fa[x]);
rank[x]=(rank[x]+rank[fa[x]])%2;
fa[x]=tx;//原来一直忘了这句话,结果一直tle
return fa[x];
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator