HDU3870 Catch the Theves

http://acm.hdu.edu.cn/showproblem.php?pid=3870

平面图转对偶图板题,方法见https://wenku.baidu.com/view/8f1fde586edb6f1aff001f7d.html

平面图的最小割等于对偶图的最短路

#include
using namespace std;

const int maxl=410;
const int inf=2e9+10;

int n,m,s,t,tot,ans;
int a[maxl][maxl],num[maxl][maxl];
int dis[maxl*maxl];
struct ed
{
	int to,l;
};
vector e[maxl*maxl];
typedef pair p;
priority_queue,greater

>q; bool in[maxl*maxl]; inline void prework() { scanf("%d",&n); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) scanf("%d",&a[i][j]); s=1;t=(n-1)*(n-1)+2; for(int i=s;i<=t;i++) e[i].clear(); tot=1; for(int i=1;i

 

你可能感兴趣的:(平面图)