USACO 2.3.4 Money Systems
来源:互联网 发布:java b2b2c 开源下载 编辑:程序博客网 时间:2024/05/21 11:04
注意状态的定义与转移
#include <iostream>#include <fstream>#include <string>#define LL long long//#define LOCALusing namespace std;#ifdef LOCALofstream fout ("out.txt");ifstream fin ("in.txt");#elseofstream fout ("money.out");ifstream fin ("money.in");#endifint v[30];LL dp[10010][30];int main() {int num;int sum;fin>>num>>sum;for (int i = 1; i <= num; ++i)fin>>v[i];for (int i = 1; i <= num; ++i){for (int j = 1; j <= sum; ++j){ dp[0][i] = 1; dp[j][i] += dp[j][i-1]; if(j>=v[i]) dp[j][i] += dp[j-v[i]][i];}}fout<<dp[sum][num]<<endl; return 0;}
0 0
- USACO 2.3.4 Money Systems
- USACO 2.3.4 Money Systems
- USACO 2.3 Money Systems (money)
- USACO--2.3Money Systems+dp
- USACO 2.3 Money Systems 题解
- USACO 2.3.4 Money Systems(母函数)
- 【USACO题库】2.3.4 Money Systems货币系统
- USACO section 2.3 Money Systems(dp)
- USACO 2.3 Money Systems (DP 动态规划)
- USACO-Section 2.3 Money Systems(DP)
- USACO 2.3Money Systems(简单DP)
- usaco: Money Systems
- usaco Money Systems
- USACO-Money Systems
- usaco Money Systems
- USACO-Money Systems
- 【动态规划】【USACO】Money Systems
- USACO :Money Systems解题报告
- 自定义UITableView每组头部控件
- JAVA_SE基础——38.单例设计模式
- 在VS2010下创建一个OpenGL的程序框架
- iOS字典数组,把每个字典对象转成一个模型对象
- 不用额外变量交换两个整数的值
- USACO 2.3.4 Money Systems
- VS2013 fopen_s 用法
- 【小游戏】俄罗斯方块(C++版)
- HTML冷门标签
- POD类型的几点总结
- runtime之实现方法交换(简单版本)
- HTTP摘要认证方式分析与验证
- maven POM.xml 标签详解
- poj 2189/3061 贪心(找连续的羊圈/连续子序列之和大于limit的最短序列)