这题wa了好久,然后再discuss里看了一下,查询的字符串居然可以重复出现,也就是说12aaa应该是2不是1。。。。 感觉再也不会爱了== 1 #include<iostream> 2 #include<cstdio> 3 #include<string.h> 4 #include<queue> 5 using namespace std; 6 const int maxn=10001; 7 char tree[51],p[maxn*100]; 8 int cnt,val[maxn*50],f[maxn*50],last[maxn*50]; 9 Read More
posted @ 2013-05-26 15:31 longlongago Views(145) Comments(0) Diggs(0) Edit
AC自动机的裸题。虽然是水题却做了很久,居然在每次查询的脑残的去修改字典树的信息。还有数组开小了居然会返回wa。。。 1 #include<iostream> 2 #include<stdio.h> 3 #include<string.h> 4 #include<queue> 5 #include<algorithm> 6 using namespace std; 7 const int maxn=85010; 8 const int sig=100; 9 int ch[maxn][sig],last[maxn],f[maxn],nu Read More
posted @ 2013-05-26 00:18 longlongago Views(126) Comments(0) Diggs(0) Edit