UVA - 357 Let Me Count The Ways
来源:互联网 发布:java数据库编程宝典 编辑:程序博客网 时间:2024/05/13 05:09
找零问题,不解释
#include<cstdio>#include<cstring>#include<algorithm>#define MAX 35000using namespace std;long long dp[MAX],coin[5]={1,5,10,25,50};int main(){ int n,i,j; memset(dp,0,MAX); dp[0]=1; for(i=0;i<5;i++) { for(j=coin[i];j<MAX;j++) dp[j]+=dp[j-coin[i]]; } while(scanf("%d",&n)!=EOF) { if(n<5) printf("There is only 1 way to produce %d cents change.\n",n); else printf("There are %lld ways to produce %d cents change.\n",dp[n],n); } return 0;}
0 0
- uva 357 Let Me Count The Ways
- uva 357 - Let Me Count The Ways
- UVA 357 Let Me Count The Ways
- UVA 357 Let Me Count The Ways
- UVa 357 - Let Me Count The Ways
- UVa 357 - Let Me Count The Ways
- uva 357 let me count the ways
- UVa 357 - Let Me Count The Ways
- UVa 357 - Let Me Count The Ways
- UVA-357-Let Me Count The Ways
- UVA 357 Let Me Count The Ways
- UVa:357 Let Me Count The Ways
- UVa 357: Let Me Count The Ways
- UVA - 357 Let Me Count The Ways
- UVa 357 - Let Me Count The Ways
- uva 357 Let Me Count The Ways
- uva 357 - Let Me Count The Ways
- uva 357 Let Me Count The Ways
- 又好又快,免费学习编程的9个地方
- 站内搜索 代码(Baidu,Google,Yahoo)
- 多个有序数列中查找第k小值
- linux格式化
- 面向对象--属性
- UVA - 357 Let Me Count The Ways
- 分享 原创的一个模拟鼠标键盘操作的 设置简单 示例可以模拟向QQ群,以及QQ群内成员发送信息。
- Leetcode:Singel Number
- Android系统Recovery工作原理之使用update.zip升级过程分析(二)---update.zip差分包问题的解决
- 公钥与私钥、数字签名
- 用java实现结婚、离婚小程序,其中有一些判断条件,正确掌握this关键字的用法
- CGAffineTransform相关函数
- kail linux 基本设置
- jpg转pdf转换器注册码