随笔分类 - 二分图
摘要:https://www.jvruo.com/archives/215/ https://www.renfei.org/blog/bipartite-matching.html
阅读全文
摘要:Link Solution 1 Hungarian: class Solution { public: int m,n; vector<vector<int>> g; vector<vector<int>> dir={{0,-1},{-1,-1},{1,-1},{0,1},{-1,1},{1,1}}
阅读全文
摘要:题目链接 题解: 每一个子连通图,对它进行黑白染色,然后取两种染色中的最小值,然后最后汇总。 #include <bits/stdc++.h> # define LL long long using namespace std; const int maxn=10000+10; const int
阅读全文
摘要:题目链接 题解: 我们可以对棋盘进行黑白染色,使得任意相邻的两个格子颜色不相同,然后进行二分图最大匹配。 Code: 1 class Solution { 2 public: 3 int N; 4 int M; 5 6 vector<vector<int>> dir{{1,0},{0,1},{-1,
阅读全文
摘要:题目链接 Code: 1 class Solution { 2 public: 3 int sub; 4 int assignBikes(vector<vector<int>>& workers, vector<vector<int>>& bikes) { 5 int N=workers.size(
阅读全文
摘要:题目链接 Code: 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 6 const int N=301; 7 int n; 8 int grid[N][N]; 9 int expx[N]; 10 int expy[N]; 11 int
阅读全文

浙公网安备 33010602011771号