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. cmd find命令

    find 作用:从文件中收索字符串 格式:find 参数 "字符串" 路径\文件名 参数: /V 显示所有未包含指定字符串的行. /C 仅显示包含字符串的行数. /N 显示行号. ...

  2. Xcode6新建的工程没有Frameworks文件夹了?!原来是这样

    http://stackoverflow.com/questions/24181062/default-frameworks-missing-in-xcode-6-beta They are impo ...

  3. epub格式电子书剖析之三:NCX文件构成

    ncx文件是epub电子书的又一个核心文件,用于制作电子书的目录,其文件的命名通常为toc.ncx. ncx文件是一个XML文件,该标准由DAISY Consortium发布(参见http://www ...

  4. java基础之运算符

    运算符是用于表示数据的赋值,运算和比较的一种特殊符号.1.赋值运算符:=,+=,-=,*=,/=,%= x=1;x+=2;(相当于x=x+2,等于3),其他运算符同理 2.算术运算符:+,-,*,/, ...

  5. Lua类和类继承实现

    Lua本身是不能像C++那样直接实现继承,但我们可以用万能的table表来实现. 以下我总结了三种方式的类以及继承的实现 第一.官方的做法,使用元表实现 原理参照<Programming in ...

  6. [codevs1380]没有上司的舞会

    本题地址 http://www.luogu.org/problem/show?pid=1352 http://codevs.cn/problem/1380/ 题目描述 某大学有N个职员,编号为1~N. ...

  7. weka 集成学习

    import java.io.*;import weka.classifiers.*;import weka.classifiers.meta.Vote;import weka.core.Instan ...

  8. HW3.19

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  9. HW2.3

    import java.util.Scanner; public class Solution { public static void main(String[] args) { final dou ...

  10. Step-by-Step Guide to Portal Development for Microsoft Dynamics CRM - 摘自网络

    The Challenge Oftentimes in the world of Dynamics CRM, the need arises for non-CRM users to gain acc ...