UVA 357 - Let Me Count The Ways
来源:互联网 发布:免费网络图绘制软件 编辑:程序博客网 时间:2024/06/01 10:41
相同类型的题做过好的了, 简单dp问题。
#include <iostream>#include <cstdio>const int size = 30000 + 100;long long d[size];int c[] = {1 , 5 , 10 , 25 , 50};int main(){for(int i = 0 ; i < size ; ++i) d[i] = i / 5 + 1;for(int i = 2 ; i < 5 ; ++i){for(int j = 0 ; j < size ; ++j) if(j >= c[i])d[j] += d[j-c[i]];}int n;while(scanf("%d" , &n) == 1){if(d[n] > 1) printf("There are %lld ways to produce %d cents change.\n" , d[n] , n);else printf("There is only 1 way to produce %d cents change.\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
- 如何提升企业网络曝光率?
- 认真是一种能力
- Android--五大布局(1)线性布局LinearLayout
- 手机测试总结----经验总结一
- Fast Uninstall Tool 快速卸载工具 v1.1.0.2345 发布
- UVA 357 - Let Me Count The Ways
- 巧妙的算法世界
- Oracle建表常用数据类型详解(转载)
- 2014年以及以后的状态
- Shell排序(希尔排序)
- ssh 常用命令
- How can I dump only certain entries of a table based on my condition?
- mongodb c++ driver 2.0编译使用
- D3DXCreateFont”: 函数不接受 12 个参数