I use blog to record something.
// // Created by dhy on 18-9-14. // # include <iostream> # include <string> # include <queue> using...
NOIP好像不考,介于时间紧,学的比较匆忙,日后复习 用途 就是用于多模式串的匹配问题 步骤 1.所有的模式串构建一棵trie树。 2.对Trie上的所有节点构造前缀指针。 3.利用前缀指针对主串进行匹配。 算法流程 树上KMP,见板子
const N = 50000; const sigmaSize = 26;//字符集大小 int trie[N][sigmaSize]; int total = 1; bool endOfWords[N]; void insert...
KMP板子 void next(){ j=0; for (int i=2;i<=lb;i++) { while(j&&b[i]!=b[j+1]) ...
思想很简单,不加赘述,见模板
# include <iostream> # include <queue> # include <algorithm> # include <string> using namespa...