摘要:
以下代码是输出有多少个集合。 模板题。 #include<iostream> using namespace std; int a[1007], ans; int find(int x) //找根 { int r = a[x]; while (r != a[r]) { //不断查找其父亲,当自己值等 阅读全文
摘要:
缺点十分明显,十分占空间。 代码如下: //图遍历不重复路径输出bfs版 #include<iostream> #include<queue> using namespace std; int minn = 99999999; int map[107][107], n, m, endd; struc 阅读全文