这个题郁闷了。。。
卡了好长时间,不过还好过了。将不相邻的点分为一组,也就是横纵坐标相加为奇数的为一组,另外为一组,然后相邻的在两组中间连一条线,最后求最大匹配
code:
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};
struct node
{
int no,x,y;
}left[52],right[52];
int n,m,k,cnt;
bool graph[52][52];
bool map[102][102];
int No[102][102];
int lcnt,rcnt;
bool vis[52];
int link[52];
bool fi......
阅读全文