hdu 1587 Flowers
2016-06-05 13:40
429 查看
Flowers
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3679 Accepted Submission(s): 2412[align=left]Problem Description[/align]
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?
[align=left]Input[/align]
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.
[align=left]Output[/align]
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.
[align=left]Sample Input[/align]
2 5
2 3
[align=left]Sample Output[/align]
2
#include <iostream> using namespace std; int main(){ int n, m, num; while(cin >> n >> m){ int min = 1000; for(int i = 0; i < n; i++){ cin >> num; if(num < min) min = num; } cout << m / min << endl; } return 0; }
相关文章推荐
- Android之Notification的多种用法
- 15.2 登录 注册
- Mysql创建数据库为中文字符
- /etc/rc.d/init.d/ssh
- 一、运维学习和发展的一个线路
- 设计模式2之策略模式
- 用java花一棵树(Applet)转
- LeetCode-329.Longest Increasing Path in a Matrix
- 我的nginx配置文件
- 个人最终总结
- 15.1 迭代器
- 个人总结
- UGUI实现页面滑动
- 最小二乘法 来龙去脉
- 第十四周进度条
- java注解的用法
- node.js mysql 初探笔记
- Android.SuperNotCalledException报错异常信息的解决方案
- 将博客搬至CSDN
- 如何开始你的安卓开发之旅