随笔分类 -  算法 / 高级数据结构

摘要:并查集模板: #include <iostream> #include <vector> using namespace std; // 初始化父节点数组 vector<int> fa; // 查找根节点并进行路径压缩 int findParent(int x) { if (x == fa[x]) 阅读全文
posted @ 2024-12-28 15:12 安娜アンナ 阅读(25) 评论(0) 推荐(0)