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 ;
}

hdu 1587 Flowers的更多相关文章

  1. HDOJ(HDU) 1587 Flowers(水、、)

    Problem Description As you know, Gardon trid hard for his love-letter, and now he's spending too muc ...

  2. HDU 1587 Flowers【贪心】

    题意:给出n种花的价钱,和总的金额m,问最多能够买到多少朵花.先排序,然后就是便宜的花在能够买的范围内能够多买就多买 #include<iostream> #include<cstd ...

  3. hdu 4325 Flowers(区间离散化)

    http://acm.hdu.edu.cn/showproblem.php?pid=4325 Flowers Time Limit: 4000/2000 MS (Java/Others)    Mem ...

  4. HDU 4325 Flowers 树状数组+离散化

    Flowers Problem Description As is known to all, the blooming time and duration varies between differ ...

  5. hdu 1587

    Problem Description As you know, Gardon trid hard for his love-letter, and now he's spending too muc ...

  6. HDU 4325 Flowers(树状数组)

    Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Sub ...

  7. HDU 4325 Flowers(树状数组+离散化)

    http://acm.hdu.edu.cn/showproblem.php?pid=4325 题意:给出n个区间和m个询问,每个询问为一个x,问有多少个区间包含了x. 思路: 因为数据量比较多,所以需 ...

  8. 2013 多校联合2 D Vases and Flowers (hdu 4614)

    Vases and Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others ...

  9. (线段树 区间运算求点)Flowers -- hdu -- 4325

    http://acm.hdu.edu.cn/showproblem.php?pid=4325 Flowers Time Limit: 4000/2000 MS (Java/Others)    Mem ...

随机推荐

  1. 转 Xcode磁盘空间大清理

    http://www.iwangke.me/2013/09/09/clean-xcode-to-free-up-disk-space/#jtss-tsina 我的设备是Macbook Air 13’ ...

  2. chrome的timeline的问题?

    如图:Stalled.RequestSent等所表达的是什么意思呢? Stalled是浏览器得到要发出这个请求的指令,到请求可以发出的等待时间,一般是代理协商.以及等待可复用的TCP连接释放的时间,不 ...

  3. c#中字符串截取使用的方法

    AndyZhang welcome to java world c#中字符串截取使用的方法 String substring(int beginIndex) String substring(int ...

  4. 【翻译】Selenium IDE v1.0.11 支持转换格式吗?

    原文: http://blog.reallysimplethoughts.com/2011/06/10/does-selenium-ide-v1-0-11-support-changing-forma ...

  5. json包的loads dumps区分

    符合json格式的字符串    --(json.laods)-->     json(字典形式或是列表形式)    --(json.dumps)-->    符合json格式的字符串

  6. 安装qc 出现error An error occurred while attempting to connect to the database.

    When trying to install mercury quality center starter edition 9.0 on Windows XP media center, I am g ...

  7. SSE 标准化向量

    mov esi, this ; vector u movups xmm0, [esi] ; first vector in xmm0 movaps xmm2, xmm0 ; copy original ...

  8. javascript设计模式2

    接口:利 固化一部分代码 弊 丧失js的灵活性 在JavaScript中模仿接口 /* interface Composite{ function add(child); function remov ...

  9. HUD-4602 Partition 排列

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4602 把n等效为排成一列的n个点,然后就是取出其中连续的k个点.分两种情况,一种是不包含两端,2^( ...

  10. POJ-2442 Sequence K路归并问题

    题目链接:http://poj.org/problem?id=2442 问题一:K个有序表合成一个有序表,元素共有n个.用堆优化 问题二:两个序列的前n小的元素.堆优化. 这题就是问题二的扩展,每次处 ...