杭电1587
来源:互联网 发布:淘宝购物返利模式 编辑:程序博客网 时间:2024/06/06 08:55
水题!!!
刚开始以为是多重背包,,啊啊啊啊,
其实只要知道价格最小的x,然后m/x就是答案!!!
我排序找的,其实可以遍历查找,不改了,没意思。
#include<stdio.h>#include<stdlib.h>int cmp (const void *a,const void *b){return *(int *)a-*(int *)b;}int main(){int n,m,i,a[10002];while(scanf("%d%d",&n,&m)!=EOF){for(i=0;i<n;i++)scanf("%d",&a[i]);qsort(a,n,sizeof(a[0]),cmp);printf("%d\n",m/a[0]);}return 0;}
- 杭电1587
- 杭电1587
- 杭电1587Flowers
- 杭电
- 杭电
- 杭电
- 杭电 HDU ACM 1587 Flowers
- 杭电 1234 和 杭电 2115
- 杭电2056之Rectangles 杭电
- 杭电ACM1061Rightmost Digit
- 杭电2099 7.11
- 杭电ACM 1003
- 杭电 ACM 2016
- 杭电ACM1466
- 杭电ACM1003
- 杭电ACM1225
- 杭电ACM2023
- 杭电ACM2602
- 游戏系统之我见
- 二叉树遍历方式
- Python MySQLdb 学习总结
- 关于spec cpu2000的编译问题.
- BaseAdapter 中getItem 的用途
- 杭电1587
- C# 不加web引用,动态调用webservice
- 关于Opencv2.4.x中stitcher类的简单应用
- IMP命令参数知多少
- Linux 下 C 网络编程之 多线程通信 实例
- C++ Template learning notes
- LeadWerks-User Guide-Asset Browser
- 8种Nosql数据库系统对比
- 20、jQuery剖析