题目大意:有两个机器,A机器有n种工作模式,B机器有m种工作模式,刚開始两个机器都是0模式.假设要切换模式的话,机器就必须的重新启动 有k个任务,每一个任务都能够交给A机器的i模式或者B机器的j模式完毕,问要重新启动多少次机器才干完毕任务 解题思路:两个机器的点分为两个点集.点集之间的关系就是任务了.要将全部任务都完毕.就要将全部边都覆盖掉,所以就是求最小点覆盖了. 这里有一个点要注意.假设全部任务中都有一个0,那么机器就不用重新启动了,重新启动次数就为0了(由于刚開始都是0) #include…
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,B 分别有 n,m 种模式. 现在有 k 个任务.对于每个任务 i ,给定两个整数$ a_i\(和\) b_i$,表示如果该任务在 A上执行,需要设置模式为 \(a_i\):如果该任务在 B** 上执行,需要设置模式为$ b_i$. 每台机器第一次开机默认处在0模式,且第一次开机不需要消耗时间.任务可以以任意顺序被执行,但每台机器转换一次模式就要重启一次.求怎样分配任务并合理安排顺序,能使机器重启次数最少. 1 \leq n,m \leq 1001≤n,m≤100,1…
传送门 Description 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 satisfied and the type of…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1150 有两个机器a和b,分别有n个模式和m个模式.下面有k个任务,每个任务需要a的一个模式或者b的一个模式完成. 两个机器初始都是0模式,一个机器转换一个模式需要重启一次.问你最少需要重启几次能完成所有的任务. 不太明显的二分匹配,将每个任务的两个模式连线,大概就能看出来这是个最小点覆盖问题. /* 将下面任务的a状态和b状态连边,线的个数就是任务个数. 要使重启次数最少,那么就要使选择的点最少而且…
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 satisfied and the type of schedule desire…
题目地址:http://poj.org/problem?id=2226 二分图的题目关键在于建图.因为“*”的地方只有两种木板覆盖方式:水平或竖直,所以运用这种方式进行二分.首先按行排列,算出每个"*"的序号xi,再按列排序,算出序号yi. 从X集合向Y集合连边.G[xi][yi]=1; 然后就是求二分图的最小顶点覆盖.因为二分图最小点覆盖=最大匹配数.所以匈牙利算法求一下最大匹配就可以了. #include<cstdio> #include<iostream>…
题目链接: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…
Machine Schedule 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 satisfied and the type o…
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…