POJ 2226 Muddy Fields
题目链接
题意:给定一个图,要求用纸片去覆盖'*'的位置,纸片可以重叠,但是不能放到'.'的位置,为最少需要几个纸片
思路:二分图匹配求最小点覆盖,和放车那题基本一样,就是注意要预处理一下行列,把连续横的'*'当成一行,竖的'*'当成一列,建图跑最小点覆盖即可
代码:
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 55;
const int M = 1505;
int n, m, tox[N][N], toy[N][N], xn, yn;
char str[N......
阅读全文