-------------------二分图-------------------
文章平均质量分 72
UMR小豪
这个作者很懒,什么都没留下…
展开
-
poj 2400 Supervisor, Supervisee
Supervisor, Supervisee Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2764 Accepted: 773 Description Suppose some supervisors each get to hire a new per原创 2017-01-12 16:20:21 · 352 阅读 · 0 评论 -
餐巾计划问题
关键是要想到建立二分图,这个确实一开始没想到。 重点是把当天需要的和当天剩下的给分开。这样就可以建图了。 1.对于当天需要的,跟源点连边,流量为rir_i,花费为p。跟汇点连边,花费为0,流量为rir_i。 2.对于当天剩下的,跟源点相连,流量为rir_i,因为当天的肯定会剩下的,然后对于第i天,向第i+1天连边,花费0,流量为inf。因为当天的可以放到第二天。然后对于第i天剩下的,可以向第i原创 2017-09-15 17:47:31 · 214 阅读 · 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 · 271 阅读 · 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 · 213 阅读 · 0 评论 -
CF19E Fairy
Once upon a time there lived a good fairy A. One day a fine young man B came to her and asked to predict his future. The fairy looked into her magic ball and said that soon the fine young man will meet原创 2017-08-18 14:17:45 · 450 阅读 · 0 评论 -
hdu1565 方格取数(1)
方格取数(1) Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 8656 Accepted Submission(s): 3299 Problem Description 给你一个n*n的格子的棋盘,每个格原创 2017-05-09 19:03:51 · 301 阅读 · 0 评论 -
Gym - 100502 A - Amanda Lounges
题目链接:https://odzkskevi.qnssl.com/7bdafb89605bd39aff640413e2d2157a?v=1488601228。 题意:大意就是有n个飞机场,每个飞机场可能有个休息室,然后给你m组关系,每组关系有3个数x,y,z,表示若z=0,表示x、y飞机场都没有休息室。若z=1,表示x、y其中有一个有休息室,若z=2,表示两个都有休息室。问总共最少有几个休息转载 2017-04-28 22:07:03 · 452 阅读 · 0 评论 -
poj3041 Asteroids
Asteroids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20174 Accepted: 10948 Description Bessie wants to navigate her spaceship through a dangerous as原创 2016-08-03 11:20:02 · 294 阅读 · 0 评论 -
poj3020 Antenna Placement
Antenna Placement Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8605 Accepted: 4263 Description The Global Aerial Research Centre has been allotted the原创 2016-08-03 11:31:25 · 876 阅读 · 0 评论 -
Kingdom of Obsession
Kingdom of Obsession Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description There is a kindom of obsession, so people in this kingdom do thing原创 2016-10-29 16:23:39 · 826 阅读 · 2 评论 -
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 · 202 阅读 · 0 评论