二分图和最大匹配
文章平均质量分 63
UMR小豪
这个作者很懒,什么都没留下…
展开
-
Kingdom of Obsession
Kingdom of ObsessionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThere is a kindom of obsession, so people in this kingdom do thing原创 2016-10-29 16:23:39 · 824 阅读 · 2 评论 -
poj 1422 Air Raid(最小不相交路径覆盖)
最小不相交路径覆盖 = 顶点数 - 最大匹配#include <cstdio>#include <vector>#include <queue>using namespace std;typedef long long LL;const int MAXN = 120+5;const int inf = 1e9;int n,m;vector<int>head[MAXN];bool vi原创 2017-09-02 20:27:02 · 226 阅读 · 0 评论 -
poj 2226
题意:给你一个n∗mn*m的图,其中’*’表示需要覆盖的地方,’.’表示不能被覆盖的地方。然后你每次可以在一行或者一列内覆盖掉连续的部分。 思路: 首先我们先按照行和列进行标号。 Sample则转化为:1 0 2 0 0 3 3 3 4 4 4 0 0 0 5 0把这些序号加入行集合,再按列做一次则为:1 0 4 0 0 3 4 5 2 3 4 0 0 0 4 0 加入列集合。原创 2017-08-28 22:03:50 · 269 阅读 · 0 评论 -
Power OJ 魔术球问题
嗯,如果i+j为平方数的话,就代表可以连边i,j。然后放在柱子上,最多能放多少球,就是在有限的柱子内放更多的球,反过来想,对于确定的球来说,用最少的柱子其实就是求一个最小路径覆盖。那么我们去枚举答案球的个数,然后找到最小路径覆盖数刚好大于给定的n的时候,那么答案就是当时的球数-1。建图不要暴力去建,会超时。我们不难发现,当球的个数加1的时候增加的边其实不多。#include <bits/stdc++原创 2017-09-13 21:38:42 · 339 阅读 · 0 评论 -
poj3692 Kindergarten
Kindergarten Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7244 Accepted: 3568 DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know each other and原创 2017-08-11 21:57:38 · 212 阅读 · 0 评论 -
最大团
#include<cstdio>#include<cstring>#define N 1010bool flag[N], a[N][N];int ans, cnt[N], group[N], n, vis[N];// 最大团: V中取K个顶点,两点间相互连接// 最大独立集: V中取K个顶点,两点间不连接 // 最大团数量 = 补图中最大独立集数bool dfs( int u, int转载 2017-08-11 21:53:06 · 1433 阅读 · 0 评论 -
Attacking rooks UVALive - 6525
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4536嗯,刚开始看到这道题的时候,想到dfs,如果能把每行和每列的按照障碍标号,然后当前标号作为一个标记,就可以dfs了,但是,当时没想到怎么映射,而且复杂度这样很高,因为这不是原创 2017-05-04 21:53:13 · 254 阅读 · 0 评论 -
poj3041 Asteroids
AsteroidsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20174 Accepted: 10948DescriptionBessie wants to navigate her spaceship through a dangerous as原创 2016-08-03 11:20:02 · 293 阅读 · 0 评论 -
poj3020 Antenna Placement
Antenna PlacementTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8605 Accepted: 4263DescriptionThe Global Aerial Research Centre has been allotted the原创 2016-08-03 11:31:25 · 876 阅读 · 0 评论 -
poj 1325 Machine Schedule
题意:k个任务,每个任务可以被A机器的Ai模式干掉,也可以被B机器的Bi模式干掉。嗯,典型的二分图最大匹配问题。 注意:开始的机器是位于0模式的,也就是说如果有任务能被0模式干掉,就不要连边,因为这个任务相当于已经完成了的。#include <cstdio>#include <vector>#include <queue>using namespace std;typedef long lo原创 2017-09-02 20:44:51 · 201 阅读 · 0 评论