
dp
rgtjf
这个作者很懒,什么都没留下…
展开
-
EOJ 2112 WYI
http://acm.cs.ecnu.edu.cn/problem.php?problemid=2112 题意:花费时间做题获得相应的知识,即总时间获得价值最大,背包,但本题的容量太大,变为获得价值i,需要花费的最少时间,状态方程为: f[v] = min{f[v-k]+t, f[v]} ; 初始状态:f[0] = 0, 其他为 inf ; #include #include原创 2013-06-29 21:51:35 · 621 阅读 · 0 评论 -
EOJ 2112 WYI & EOJ 2113 WYII
http://acm.cs.ecnu.edu.cn/problem.php?problemid=2112 http://acm.cs.ecnu.edu.cn/problem.php?problemid=2113 题意: 背包问题,只不过数据范围变了。假定V为容量,ti为每个物品的重量,ki为价值,求能获得的最大价值。 (一) 2112 V特别大,n大,sum(k)比较小。改为原创 2013-07-05 09:19:26 · 588 阅读 · 0 评论 -
EOJ 1255
#include #include #include using namespace std; const int maxn = 115; int dp[maxn][maxn]; int path[maxn][maxn]; char s[maxn]; void dfs( int st,int t ){ if( st>t ) return ; if( st==t ){ if( s[st原创 2013-08-30 18:12:31 · 501 阅读 · 0 评论