摘要: DP dp[i][j],i、j分别表示到第i组为止,第i组为j状态的最小花费,其中j有两种状态:0表示不翻转,1表示翻转。 阅读全文
posted @ 2016-08-15 10:12 拒绝者\n 阅读(248) 评论(0) 推荐(0)
摘要: IDA* A*部分:每次判断当前使用步数和至少还需步数的和是否满足当前解; #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> using namespace std; int T, dep; b 阅读全文
posted @ 2016-05-07 19:37 拒绝者\n 阅读(139) 评论(0) 推荐(0)
摘要: 区间DP,逆向递推; dp[i][j]表示i到j编号能取到的最大值; 状态转移方程为dp[i][j] = max(dp[i][j-1]+v[j]*day, dp[i+1][j]+v[i]*day); 注意,区间dp是随着区间增大逐步更新数据,于是要把“区间”放在循环的最外层。 1 #include 阅读全文
posted @ 2016-04-27 22:05 拒绝者\n 阅读(196) 评论(0) 推荐(0)
摘要: dp题,dp[i][j]表示i分钟j疲劳度能到达的最远距离。 i分钟时,0疲劳度可能是i-1分钟的疲劳度为0,或者i-j分钟的时候疲劳度为j然后休息。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 5 using n 阅读全文
posted @ 2016-04-26 22:42 拒绝者\n 阅读(253) 评论(0) 推荐(0)
摘要: 维护一个当前最小费用和,比较直接用当前周生产的费用和前面某一周生产的费用的大小 1 #include <stdio.h> 2 #include <string.h> 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 阅读全文
posted @ 2016-04-20 21:48 拒绝者\n 阅读(280) 评论(0) 推荐(0)
摘要: 原帖:http://tieba.baidu.com/p/1753284199 资源站:*C++资源:http://tieba.baidu.com/p/1239792581*个人推荐入门看C++ Primer,能看英文版最好,中文版也行。*NOIP1995-2011提高组试题+数据 :115.com/ 阅读全文
posted @ 2016-04-07 22:36 拒绝者\n 阅读(431) 评论(0) 推荐(0)
摘要: 留坑。 阅读全文
posted @ 2016-04-07 16:42 拒绝者\n 阅读(139) 评论(0) 推荐(0)
摘要: 留坑。。 阅读全文
posted @ 2016-04-07 16:42 拒绝者\n 阅读(77) 评论(0) 推荐(0)
摘要: 坑。。 阅读全文
posted @ 2016-04-07 16:42 拒绝者\n 阅读(109) 评论(0) 推荐(0)
摘要: 留坑。 阅读全文
posted @ 2016-04-07 16:41 拒绝者\n 阅读(101) 评论(0) 推荐(0)