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

建议使用的浏览器:

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

1587:Flowers

题目描述
As you know, Gardon trid hard for his love-letter, and now he's spending too much time on choosing flowers for Angel.
When Gardon entered the flower shop, he was frightened and dazed by thousands kinds of flowers.
"How can I choose!" Gardon shouted out.
Finally, Gardon-- a no-EQ man decided to buy flowers as many as possible.
Can you compute how many flowers Gardon can buy at most?
输入解释
Input have serveral test cases. Each case has two lines.
The first line contains two integers: N and M. M means how much money Gardon have.
N integers following, means the prices of differnt flowers.
输出解释
For each case, print how many flowers Gardon can buy at most.
You may firmly assume the number of each kind of flower is enough.
输入样例
2 5
2 3
输出样例
2


Gardon can buy 5=2+3,at most 2 flower, but he cannot buy 3 flower with 5 yuan.
来自杭电HDUOJ的附加信息
Author DYGG
Recommend linle

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

源链接: HDU-1587

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

共提交 131

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