并查集+线段树合并求调

P3224 [HNOI2012] 永无乡

@[__lottle1212__](/user/1062683) 询问时应访问x的祖先而非x
by TankYu @ 2024-08-11 09:07:40


@[__lottle1212__](/user/1062683) merge时应保留y的树,因为你最后令rt[y] = merge()
by TankYu @ 2024-08-11 09:12:44


@[__lottle1212__](/user/1062683) 应该提前初始化 rt[i] = i
by TankYu @ 2024-08-11 09:14:11


@[__lottle1212__](/user/1062683) 去掉标记永久化
by TankYu @ 2024-08-11 09:14:30


@[TankYu](/user/408071) /bx/bx/bx
by lottle1212__ @ 2024-08-11 11:26:05


求关 ~~RMB就不用了~~
by TankYu @ 2024-08-11 11:35:01


@[__lottle1212__](/user/1062683)
by TankYu @ 2024-08-11 11:35:13


|