- 博客(5)
- 资源 (2)
- 收藏
- 关注
原创 TYVJ 1860 后缀数组入门模版题
题意:。。。。。#include #include #include using namespace std;const int maxn = 200000 + 10;const int sigma_size = 27; //擦,少了个桶子 我悲剧了30次。。。。 /**suffix array*倍增算法 O(n*logn)*待排序数组长
2013-10-30 18:16:38 979
原创 hdu 3065 AC自动机模版题
题意:输出每个模式串出现的次数,查询的时候呢使用一个数组进行记录就好。同上题一样的关键点,其他没什么难度了。#include #include #include using namespace std;const int maxw = 1000 * 50 + 10;const int sigma_size = 128;const int maxl = 200
2013-10-30 10:53:30 629
原创 hdu 2896 AC自动机模版题
题意:输出出现模式串的id,还是用end记录id就可以了。本题有个关键点:“以上字符串中字符都是ASCII码可见字符(不包括回车)。” -----也就说AC自动机的Trie树需要128个单词分支。 #include #include #include using namespace std;const int maxw = 210 *500 + 10;co
2013-10-30 10:50:10 655
原创 HDU 2222 AC自动机模版题
所学的AC自动机都源于斌哥和昀神的想法。题意:求目标串中出现了几个模式串。使用一个int型的end数组记录,查询一次。#include #include #include using namespace std;const int maxw = 50 * 10000 + 10;const int sigma_size = 26;const int max
2013-10-30 10:47:37 776
原创 UVALive 3942 Remember the Word 字典树DP&&前缀树
题目描述:给你一个由S个不同单词组成的字典和一个长字符串。把这个字符串分解成若干个单词连接()单词可以重复使用),求有多少种方法。Sol: 递推 dp[i]=sigma_sum (dp[i+len(x)])dp[i]表示从字符i开始的字符串即后缀(s[i..L])的分解方案数。x为是 (s[i..L]的前缀)。先把所有单词放在trie上,然后在trie上查找S[i....L],
2013-10-22 21:25:41 677
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人