c语言sscanf函数的用法是什么
328
2022-09-06
sdut2408 Pick apples
Pick apples
Time Limit: 1000ms Memory limit: 165536K 有疑问?点这里^_^
题目描述
Once ago, there is a mystery yard which only produces three kinds of apples. The number of each kind is infinite. A girl carrying a big bag comes into the yard. She is so surprised because she has never seen so many apples before. Each kind of apple has a size and a price to be sold. Now the little girl wants to gain more profits, but she does not know how. So she asks you for help, and tell she the most profits she can gain.
输入
In the first line there is an integer T (T <= 50), indicates the number of test cases. In each case, there are four lines. In the first three lines, there are two integers S and P in each line, which indicates the size (1 <= S<= 100) and the price (1 <= P <= 10000) of this kind of apple.
In the fourth line there is an integer V,(1 <= V <= 100,000,000)indicates the volume of the girl's bag.
输出
For each case, first output the case number then follow the most profits she can gain.
示例输入
11 12 13 16
示例输出
Case 1: 6
提示
来源
2012年"浪潮杯"山东省第三届ACM大学生程序设计竞赛
大范围先贪心,小范围背包。
但背包的范围也不能太小,不然就不对了。
把10000该为100就会WA
贪心算法和背包算法要好好再看看
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~