```cpp
father[x]=xz(y);
```
你这句话不是应该这么写吗:
```cpp
father[xz(x)]=xz(y);
```
by info___tion @ 2018-10-29 14:11:04
```cpp
father[x]=xz(y);
```
是
```
father[xz(x)]=xz(y)
```
by 一叶知秋。 @ 2018-10-29 14:11:50
@[铭玘](/space/show?uid=67249)
by 一叶知秋。 @ 2018-10-29 14:12:03
```cpp
if(z==1)
{
father[xz(x)]=xz(y);
}
```
把这改一下就A了
by Ghoster @ 2018-10-29 14:12:59
@[铭玘](/space/show?uid=67249) 没错没错就是这里
by 只用函数 @ 2018-10-29 14:13:00
@[铭玘](/space/show?uid=67249)
```
if(z==1)
{
father[x]=xz(y);
}
```
改成
```
if(z==1)
{
father[xz(x)]=xz(y);
}
```
就能过
by jeffqi @ 2018-10-29 14:14:18
建议写成非递归版
:```
while(x!=fa[x])x=fa[x]=fa[fa[x]];
return x;
```
by foreverlasting @ 2018-10-29 14:15:40
@[加藤圣教_封仙](/space/show?uid=32878) 是因为容易递归层次溢出?
by BeingErnest @ 2018-10-29 14:17:14
@[铭玘](/space/show?uid=67249) 而且非递归版跑得快,又不会爆栈
by foreverlasting @ 2018-10-29 14:17:58
感谢各位,我忽略了只能爸爸认爸爸,
by BeingErnest @ 2018-10-29 14:17:59