Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 256000/128000 K (Java/Others)Total Submission(s): 2578 Accepted Submission(s): 713 Problem Description Aliens on planet Pandora also write computer progra…
传送门:https://www.luogu.org/problem/P3808 题解:是一个AC自动机的裸题了,注释加在代码里面了 #include<bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5, sigma_size = 26; int ch[maxn][sigma_size]; int tot; //结点总数 int ans = 0; int f[maxn]; //失配函数 int last[maxn];//表示…
Keywords Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 77903 Accepted Submission(s): 27032 Problem Description In the modern time, Search engine came into the life of everybody lik…
题中有一个坑点,就是模式串可以相同,并且全部计数. #include <bits/stdc++.h> using namespace std; const int maxn=1e6+10; const int N=maxn; char str[maxn]; struct Dfa { int trie[N][26],cnt; int e[N]; int fail[N]; char ch; void init(char c) { memset(trie,0,sizeof(trie)); memse…
Keywords Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 57353 Accepted Submission(s): 18820 Problem Description In the modern time, Search engine came into the life of everybody li…