uva 357 Let Me Count The Ways
来源:互联网 发布:战争雷霆pw42数据 编辑:程序博客网 时间:2024/05/01 21:53
简单dp ,水题
#include <iostream>#include <cstring>#include <cstdio>using namespace std;int n;int d[] = {1,5,10,25,50};long long dp[30010];int main(){memset(dp,0,sizeof(dp));dp[0] = 1;for(int i=0;i<5;i++){for(int j=0;j+d[i]<=30000;j++){dp[j+d[i]] += dp[j];}}while(cin >> n){if(dp[n]==1) 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
- 写博客目的
- 职位搜索的技巧—2014年求职六大技巧之二
- TOPO DN 解析
- uint64的压缩
- 看记录片《大师》之我见
- uva 357 Let Me Count The Ways
- Collecting Bugs - POJ 2096 dp
- FPGA研发(1)FPGA是个什么玩意?
- 十进制数与二进制, 八进制, 十六进制之间的转换
- 理解 process.initgroups(user, extra_group)
- uva 10620 - A Flea on a Chessboard(暴力+数学)
- 【iOS】Swift字符串截取方法的改进
- PHP range协议实现输出文件断点续传
- 提問的智慧