摘要: KMP简单应用,利用next,一个一个确定是否和后缀匹配#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn=400000+10; char s[maxn]; int next[maxn]; int amount[maxn]; int main() { while(~scanf("%s",s)) { int len=strlen(s); int i=0,j=-1; next[0]=-1; ... 阅读全文
posted @ 2013-04-08 21:04 LJ_COME!!!!! 阅读(110) 评论(0) 推荐(0)
摘要: 数位DP,各种理解难题#include <iostream> #include <cstdio> #include <cmath> #include <cstring> #define LL long long using namespace std; unsigned long long n; LL f1[25],f2[25],f3[25]; int s[25]; int t; int main() { cin>>t; int i,j,k; f1[0]=0;f2[0]=1;f3[0]=0; for(i=1;i<=19;i++) 阅读全文
posted @ 2013-04-08 13:54 LJ_COME!!!!! 阅读(111) 评论(0) 推荐(0)