摘要: 并查集 用一个索引代表父节点,如果根一样就是一个集合。查找的时候使用路径压缩提升效率。 #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; int P[1 阅读全文
posted @ 2025-08-01 20:13 .N1nEmAn 阅读(13) 评论(0) 推荐(0)