上一页 1 2 3 4 5 6 7 8 9 10 ··· 182 下一页
摘要: 基本的树形dp#include #include #include using namespace std;const int MAX_N = (int)(6e3) + 5;int n;int weight[MAX_N];vector edge[MAX_N];bool vis[MAX_N];int... 阅读全文
posted @ 2015-03-31 19:04 金海峰 阅读(185) 评论(0) 推荐(0) 编辑
摘要: AC自动机,用40^4 * 50 * 10的空间进行dp。最大的难点在于hash。hash一个数列f,数列中的每一位都有一个上限g,即f[i]#include #include #include #include using namespace std;#define D(x) const int ... 阅读全文
posted @ 2015-03-30 21:19 金海峰 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题意:给出n(1using namespace std;#define D(x) const int MOD = (int)(1e9) + 7;const int MAX_FACTOR = 40;int n;int factor_num;long long factor[MAX_FACTOR];lo... 阅读全文
posted @ 2015-03-29 21:55 金海峰 阅读(202) 评论(0) 推荐(0) 编辑
摘要: AC自动机+状态压缩DP注意:相同的串可能出现多次,如果匹配成功则将各次权值加和。#include #include #include using namespace std;#define D(x) const int MAX_N = 15;const int MAX_LEN = 105;cons... 阅读全文
posted @ 2015-03-27 21:19 金海峰 阅读(112) 评论(0) 推荐(0) 编辑
摘要: AC自动机+DP#include #include #include using namespace std;#define D(x) const int MAX_D_LEN = 25;const int MAX_LEN = 88;const int MAX_N = 105;const int MA... 阅读全文
posted @ 2015-03-24 20:54 金海峰 阅读(138) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 182 下一页