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

建议使用的浏览器:

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

3318:Assignment Tools

题目描述
In Valentine’s Day, lovers usually send gifts to their GF or BF. To express their sincerity, they choose DIY.

Small JH want to make a surprise to his GF, so he finds a shop named “DIY Space”. But there are so many people scramble for tools to make their gifts. To solve the problem, the boss makes a rule:

1.You will not regain the tool until you can complete all things what you need to do.(If someone has all tools he needs, he will complete immediately. Otherwise, he can’t do anything)

2.If the boss has enough tools he will give you when you need tools.

3.You don't have to queue up.

Small JH should wait until all people leave, because he needs all tools.

People have their tools and never return before completing their tasks. Sometimes it has a state: the boss has no tools any more and everyone can’t get enough tools.

Please tell him whether he should wait.
输入解释
The input consist of several cases, please deal with till the end of file. Each case contains two integers N and M (0 < N, M <= 100), representing there are N kinds of tools and M people. Second line there are N integers, N(i) means the boss own Ni number of ith tool(equal to the number of tools Small JH need).Then follow M lines, each consisting N integers, the number in ith row and jth column means the amount of the jth tools that the ith people need. After it there also M lines, each line has N integers too, the number in ith row and jth column means this amount of jth tools have been allotted to the ith people.

The total number of ith tool that all people own will not bigger than boss own at first.
输出解释
Please print “Yes” if Small JH can wait the end, or print “No” if he can’t;
输入样例
2 2
10 11
9 8
5 8
2 3
3 5

2 2
10 10
9 8
5 8
2 3
3 5
输出样例
Yes
No
来自杭电HDUOJ的附加信息
Author Tuzkier
Recommend wxl

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

源链接: HDU-3318

最后修改于 2020-10-25T23:02:18+00:00 由爬虫自动更新

共提交 1

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