当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2474:Process scheduling

题目描述
Process scheduling is a very important problem in operating system design. Each process requires some amount of resources to run. The process will release all the resources allocated to it when completes. Different resource allocating strategy varies much in efficiency. Even some unsuitable strategy can result in dead lock.
Now there are n processes and m kinds of resources. At the beginning, each process has been allocated some amount of resources for each kind. However, the allocated resources might not be enough. They still need some extra resources for each kind. And you are given the available resources for each kind in the computer now. Can you tell whether it is possible to schedule these processes in a suitable order so that all of them can be executed successfully?
输入解释
There are four parts in the input.
The first part contains two positive integers n(n<=50000) and m(m<=3) representing the number of processes and the number of resources.
The second part is the following m lines. Each of the m lines contains n integers. These integers make the allocation table.
The third part is also the following m lines. Each of the m lines contains n integers. These integers make the request table.
The last line containing m integers is the fourth part. This part tells you the amount of available resources for each kind currently.
You may assume all integers that appear are less than or equal to 10^9.
输出解释
The output contains only ‘Yes’ or ‘No’.
If all processes can be executed, output ‘Yes’. Otherwise, output ‘No’.
输入样例
4 3
1 6 2 0
0 1 1 0
0 2 1 2
2 0 1 4
2 0 0 2
2 1 3 0
0 1 1
4 3
2 5 2 0
0 1 1 0
1 1 1 2
1 1 1 4
2 0 0 2
1 2 3 0
0 1 1
输出样例
Yes
No
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2474

最后修改于 2020-10-25T22:53:47+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/2000MS(Java/Others) 32768/32768K(Java/Others)