UVA 11419 - SAM I AM 题目链接 题意:给定一个棋盘,上面有一些目标,现在要放炮,一个炮能打一行或一列,问最少放几个炮及放炮位置 思路:首先是二分图匹配,每个目标行列建边,做二分图匹配就是最少的放炮位置,至于输出方案,利用最小点覆盖的Konig原理去做,详细证明 代码: #include <cstdio> #include <cstring> #include <vector> using namespace std; const int N = 10
Muddy Fields Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8434 Accepted: 3124 Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, t
Vertex Cover frog has a graph with nn vertices v(1),v(2),-,v(n)v(1),v(2),-,v(n) and mm edges (v(a1),v(b1)),(v(a2),v(b2)),-,(v(am),v(bm))(v(a1),v(b1)),(v(a2),v(b2)),-,(v(am),v(bm)). She would like to color some vertices so that each edge has at least