hdoj 2222 Keywords Search 【字典树挤进1ms----啊--我要学AC自动机】
传送门:2222
正要学AC自动机--发现 k*n=5*10^7 -- 就用单纯的字典树过了--
建树--扫描字符串--统计---
代码:
#include
#include
#include
using namespace std;
struct trie{
trie * child[26];
int shu;
int hao;
}P[600000];
int
原创
2016-08-11 09:34:39 ·
435 阅读 ·
0 评论