摘要:
蒙德里安的梦想 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namespace std; typedef long long ll; const int N = 12; const i 阅读全文
摘要:
原理 对二分图的一边进行匹配尝试,最后再次遍历统计成功次数 O(nm) //但是实际情况一般少于O(nm) 模板 二分图的最大匹配 #include<iostream> #include<cstring> using namespace std; const int N = 100010; int 阅读全文
摘要:
原理 1,2为两种颜色,0为未染色 根据染色是否成功判断是否为二分图 模板 染色法判定二分图 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 200010; int 阅读全文
摘要:
使用 稀疏图求最小生成树边权和 O(mlogm) 模板 Kruskal算法求最小生成树 #include<iostream> #include<algorithm> using namespace std; const int N = 200010; int n,m; int p[N]; //并查集 阅读全文
摘要:
多源路算法(O(n ^ 3)) Floyd求最短路 #include<iostream> #include<algorithm> using namespace std; const int N = 210,null = 0x3f3f3f3f; int d[N][N]; int n,m; //遍历更 阅读全文