Files
luogu/solutions/P2607.md
T
hanyixuanten 43d9b98755
Check cpp / md pair / Check md headers (push) Successful in 4s
Sync solutions to Wiki / sync (push) Successful in 4s
fix
2026-10-29 06:04:21 +00:00

12 lines
409 B
Markdown

# P2607 [ZJOI2008] 骑士 题解
先看[P1453](./P1453.md)
只需要将仇恨关系视作一个连边即可。
本题与[P1453](../P1453.md)的区别是形成的不只是一个树+断边,而是一个森林+断边。
只需要将 [P1453 的并查集](../P1453.cpp#L35-L41)改为[保存 $S, T$ vector](../P2607.cpp#L33-L39),随后对于每个树+断边仿照 P1453 的实现即可
[code](../P2607.cpp)