杭电 HDU ACM 1587 Flowers
来源:互联网 发布:suse linux官网 编辑:程序博客网 时间:2024/06/04 18:34
Flowers
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3066 Accepted Submission(s): 2052
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?
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.
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.
You may firmly assume the number of each kind of flower is enough.
Sample Input
2 52 3
Sample Output
2Gardon can buy 5=2+3,at most 2 flower, but he cannot buy 3 flower with 5 yuan.HintHint
Author
DYGG
Source
有那么简单么! 丫的蛋蛋。
#include<iostream>using namespace std;int main(){int n,m,ls[1000];while(cin>>n>>m){for(int i=0;i<n;i++)cin>>ls[i];int min=10000000;for(int j=0;j<n;j++)if(ls[j]<min)min=ls[j];cout<<m/min<<endl;}return 0;}
0 0
- 杭电 HDU ACM 1587 Flowers
- 杭电1587Flowers
- hdu 杭电acm 1002
- 杭电ACM HDU 1004
- 杭电ACM HDU 1002
- 杭电ACM HDU 1008
- 杭电ACM HDU 1013
- 杭电ACM HDU 1014
- 杭电 acm Saving HDU
- 杭电 HDU ACM 圆桌会议
- 杭电 HDU ACM Milk
- 杭电ACM--HDU-1061
- 杭电ACM--HDU-1425
- 杭电ACM-HDU 1982
- 杭电 HDU ACM 1002
- HDU 1587 Flowers
- hdu 1587 Flowers
- hdu-oj 1587 Flowers
- [LinkedIn] Find Sqrt square root of a number (binary search)
- 【C语言】编写一个函数reverse_string(char * string)(递归实现),将参数字符串中的字符反向排列,不能使用C函数库中的字符串操作函数。
- 数据结构学习笔录---队列的实现
- 阅人月神话有感——巴比伦塔的失败
- 第五周 项目1-体验常成员函数
- 杭电 HDU ACM 1587 Flowers
- window下(或Ubuntu下)Sublime Text 2.01注册码license key
- 线程同步
- 第十一讲_项目4-玩数字
- C++实现不能被继承的类——终结类
- 通过Fildder下载百度音乐里的收费歌曲
- python中序列方法与切片实现逆序的简便方法(::-1)
- shell 常用快捷键
- 关于缓存_一次动态请求经过哪些缓存ppt