uva 147 拆钱(完全背包)
来源:互联网 发布:苏客会孵化器知乎 编辑:程序博客网 时间:2024/05/20 12:47
#include <iostream>#include <cstring>#include <string>#include <algorithm>#include <cstdio>using namespace std;int a[] = {1,2,4,10,20,40,100,200,400,1000,2000};long long dp[30000 + 5];int main(){ dp[0] = 1; for(int i = 0; i < 11; i++) for(int j = 1; j*5 <= 30000; j++) if((j-a[i])>=0) dp[j] += dp[(j-a[i])]; double temp; while(scanf("%lf",&temp)){ if(temp == 0.00) return 0; double t = temp*20; int x = t; printf("%6.2lf%17.lld\n",temp,dp[x]); } return 0;}
普通的完全背包,关键在输入输出。uva 不!能!用 I64d !!!!!!!!!!!!
阅读全文
0 0
- uva 147 拆钱(完全背包)
- uva 147 Dollars(完全背包)
- UVa 147 Dollars(DP完全背包)
- UVa 147 Dollars(DP完全背包)
- UVA - 147 Dollars(完全背包)
- UVA 147 Dollars(完全背包)
- UVA 147 Dollars (完全背包)
- UVA 147 Dollars(完全背包)
- Uva 147 Dollars 完全背包
- Uva 147 Dollars 完全背包
- uva 147 Dollars(完全背包)
- UVa 147 Dollars (完全背包)
- UVA 147 - Dollars(完全背包)
- UVA 147 Dollars (完全背包)
- uva 147 Dollars(完全背包)
- UVA - 147 Dollars(完全背包)
- UVA 147 Dollars 完全背包
- uva 147 - Dollars(动态规划--完全背包)
- * response * request * 编码 * 路径等小结
- EventBus的简单使用,消息传递
- ArrayList源码阅读c.toArray might (incorrectly) not return Object[] (see 6260652)
- solr源码导入eclipse进行编译之出现的问题
- 网络图片浏览
- uva 147 拆钱(完全背包)
- 【排序之三】归并排序
- OpenWRT下使用UVC摄像头
- Session机制详解
- list下的简易扑克牌游戏
- 打洞机制
- GetBuffer()
- 集合框架中HashMap 和HashTable concurrentHash
- Linux上free命令