hdu 1587 Flowers
2024-10-14 03:24:37
Flowers
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3679 Accepted Submission(s): 2412
Problem Description
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
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.
Output
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.
Sample Input
2 5
2 3
Sample Output
2
#include <iostream>
using namespace std; int main(){
int n, m, num;
while(cin >> n >> m){
int min = ;
for(int i = ; i < n; i++){
cin >> num;
if(num < min)
min = num;
}
cout << m / min << endl;
}
return ;
}
最新文章
- jsp使用EL表达式回传boolean值出错的问题
- JQuery 添加节点
- hibernate注解随笔—10月8日
- select()函数 timval问题
- discuz 学习
- ZOJ 3872--解题报告
- Python3导入自定义模块的3种方式
- [Session] SessionHelper2---C#关于Session高级操作帮助类 (转载)
- Scrapy的shell命令(转)
- web02--jsp数据传递
- iOS开发之内存缓存机制
- SVG轨迹回放实践
- ionic2+Angular 依赖注入之Subject ——使用Subject来实现组件之间的通信
- oracle中“ORA-00060: 等待资源时检测到死锁” 或存储过程编译卡死 解决方法
- Android 访问地址
- python3编写网络爬虫18-代理池的维护
- AI创业的技术方案选择
- RabbitMQ在特来电的深度应用
- Java冒泡具体的原理,以及下标的变化
- Laravel中不可逆的加密方法