莫名MLE

P1195 口袋的天空

@[rkbudlo](/space/show?uid=41834) @[哔哩哔哩](/space/show?uid=41868) @[DavidJing](/space/show?uid=41855) @[ADMAN](/space/show?uid=41748)
by xzjds @ 2018-10-22 19:45:29


靠,玄学 感觉不应该爆MLE啊
by 哔哩哔哩 @ 2018-10-22 19:47:57


??? 之前AC的代码WA了
by 哔哩哔哩 @ 2018-10-22 19:49:33


@[xzjds](/space/show?uid=42217) 路径压缩应该这么写 ```cpp int getfa(int x) { if(fa[x]!=x) fa[x]=getfa(fa[x]); return fa[x]; } ```
by RiverFun @ 2018-10-22 19:52:24


@[哔哩哔哩](/space/show?uid=41868) ta路径压缩写错了
by RiverFun @ 2018-10-22 19:53:52


@[Steve_braveman](/space/show?uid=96570) 我居然犯了这么愚蠢的错误。。
by xzjds @ 2018-10-22 19:54:18


@[xzjds](/space/show?uid=42217) 大佬您的getfa打错了
by Aryzec @ 2018-10-22 19:54:35


@[rkbudlo](/space/show?uid=41834) 水过了。。
by xzjds @ 2018-10-22 19:55:08


嘤,我喜欢 ``` inline int getfa(int x){ while(x!=fa[x]) x=fa[x]=fa[fa[x]]; return x; } ```
by 哔哩哔哩 @ 2018-10-22 19:55:49


@[xzjds](/space/show?uid=42217) 您强
by Aryzec @ 2018-10-22 20:17:41


|