https://vjudge.net/problem/UVA-147

题意:

换零钱,计算方案数。

思路:

完全背包,UVa674的加强版。

 #include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std; const int maxn = + ;
int coin[] = { , , , , , , , , , , };
long long d[maxn]; int main()
{
//freopen("D:\\txt.txt", "r", stdin);
int i, j;
memset(d, , sizeof(d));
d[] = ;
for (int i = ; i < ;i++)
for (int j = coin[i]; j <= maxn; j++)
d[j] += d[j - coin[i]];
double s;
while (cin >> s && s)
{
int n = (int)( * s + 0.5);
printf("%6.2lf%17lld\n", s,d[n]);
}
return ;
}

最新文章

  1. 安装 log.io 实时监控 php_error 日志
  2. iOS10遇到有推送的Demo真机报错的解决
  3. [spring源码学习]一、IOC简介
  4. SQL Server中事务、锁定和阻塞
  5. WinForm开发-界面控件到实体,实体到界面控件自动绑定
  6. cocos2d-x 3.10 屏幕适配问题
  7. sql语句操作
  8. Public and Private Interfaces in ruby
  9. 【BZOJ】2209: [Jsoi2011]括号序列(splay)
  10. PHP 迭代器模式
  11. UVALive 5135 Mining Your Own Business 双连通分量 2011final
  12. session marked for kill处理oracle中杀不掉的锁
  13. POJ burnside&amp;&amp;polya整理练习
  14. CH Round #53 -【Nescaf&#233; 32】杯NOIP模拟赛
  15. PHP学习笔记,自己动手写个MVC的框架 -- base所有代码
  16. 初试LIBSVM
  17. Gist - ES6 Proxy
  18. SpringBoot入坑-项目搭建
  19. JavaSE(一)之类与对象
  20. 微软黑科技强力注入,.NET C#全面支持人工智能

热门文章

  1. Python3学习之路~2.6 集合操作
  2. [py]彻底细究web框架的wsgi+逻辑处理模块
  3. keepalived+mysql 高可用集群
  4. [LeetCode] 127. Word Ladder _Medium tag: BFS
  5. Jmeter CSV Data Set Config参数化
  6. acrobat pro 无法编辑个别文本
  7. 利用javascript实现css操作
  8. cmd 笔记(随时补充)
  9. mysql性能优化1
  10. POJ3581 后缀数组