Poj(1325),最小点覆盖】的更多相关文章

Muddy Fields Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8881   Accepted: 3300 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…
Chessboard Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 14787   Accepted: 4607 Description Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2…
#include<stdio.h> #include<string.h> #define  N  510 int map[N][N],n,mark[N],link[N]; int find(int u) {  int i;  for(i=1;i<=n;i++)  if(!mark[i]&&map[u][i]) {     mark[i]=1;     if(link[i]==-1||find(link[i])) {         link[i]=u;    …
题目链接:http://poj.org/problem?id=1325 Machine Schedule Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14216   Accepted: 6075 Description As we all know, machine scheduling is a very classical problem in computer science and has been studi…
题目链接:http://poj.org/problem?id=1325 As we all know, machine scheduling is a very classical problem in computer science and has been studied for a very long history. Scheduling problems differ widely in the nature of the constraints that must be satis…
http://poj.org/problem?id=1325 题意: 两种机器A和B.机器A具有n种工作模式,称为mode_0,mode_1,...,mode_n-1,同样机器B有m种工作模式mode_0,mode_1,..., mode_m-1.开始时,它们都在mode_0工作. 对于给定的k个作业,可以在特定模式下的两个机器中的任一个中处理它们中的每一个.例如,作业0可以在机器A在mode_3处理,或者在机器B在mode_4处理,作业1可以在机器A中在mode_2处理,或者在机器B中在mod…
题目大意:有两个机器,A机器有n种工作模式,B机器有m种工作模式,刚開始两个机器都是0模式.假设要切换模式的话,机器就必须的重新启动 有k个任务,每一个任务都能够交给A机器的i模式或者B机器的j模式完毕,问要重新启动多少次机器才干完毕任务 解题思路:两个机器的点分为两个点集.点集之间的关系就是任务了.要将全部任务都完毕.就要将全部边都覆盖掉,所以就是求最小点覆盖了. 这里有一个点要注意.假设全部任务中都有一个0,那么机器就不用重新启动了,重新启动次数就为0了(由于刚開始都是0) #include…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=364 http://poj.org/problem?id=1325 题目大意: 给两台机器A和B,他们分别有n和m个工作模式,初始的时候都在Mode_0状态上,切换工作模式的时候必须重启机子.给你K个任务,第i个任务可以运行在A的mode_x上,B的mode_y上,求完成所有工作所需最少重启次数. 思路: 好吧,不会做.看了大神的思路: 对于任务(i,x,y),我们在A机mod…
题意 给出的是N*M的矩阵,同样是有障碍的格子,要求每次只能消除一行或一列中连续的格子,最少消除多少次可以全部清除. 思路 相当于POJ 3041升级版,不同之处在于这次不能一列一行全部消掉,那些非障碍的格子不能消. 但是我们还是要抓住关键点:每个格子必须消除,要么以行消,要么以列消.并且我们发现如果以行消得话,一定是以这连续障碍行的最左端为起点,同理列是以最上端为起点.那么我们就又把消除方式变成两种了.这时就可以把障碍当作边,两种覆盖方式分别作为两断点,求二分图最小点覆盖集. 行列方式的起点共…
http://poj.org/problem?id=3041 Asteroids Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 17543   Accepted: 9548 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <…