昂神的解题报告:http://sd-invol.github.io/2014/10/22/Anshan-2014-G/
我来对他的话进行翻译就好了…
之所以看出最小割 是因为每个位置有两种方案 这样形成二分图后 我们要进行决策 最小割也就变成了进行决策所要丢掉的最小价值
之所以根据每个位置的二进制表示中1的个数来决定该位置两种决策放在左边还是右边 是为了避免二分图中同一个集合里的两个点连边
代码:
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<bitset>
using namespace std;
#define N 300
#define inf 50000000
int T, S, n, m, tot, cas, ans;
int head[N * 2], f[N], g[N], Less[N], Lid[N], More[N], Mid[N], dis[N * 2], qu[N
* 2];
s