摘要: // Manacher算法,很好用。char s[2*N]; //储存临时串int save[2*N];//中间记录int Manacher(char tmp[]){ int len=strlen(tmp); int cnt=0; for(int i=0;i=p) { int num=1; while(i+num=0&&s[i+num]==s[i-num]) { num++; } p=i+num-1; //能到达的最远位置 ... 阅读全文
posted @ 2013-07-30 22:47 chenhuan001 阅读(488) 评论(0) 推荐(0) 编辑
摘要: 可能没有完全读懂题意。个人觉得accaaa答案应该是4.然后就是dp了。。这题数据量小很多方法都可以,数据也水暴力据说都能过。。还有就是我竟然没有用扩展kmp优化下。。。 太无耻了,我是因为找扩展kmp的题才来看这题的。Best SequenceTime Limit:1000MSMemory Limit:10000KTotal Submissions:4217Accepted:1668DescriptionThe twenty-first century is a biology-technology developing century. One of the most attractive 阅读全文
posted @ 2013-07-30 15:49 chenhuan001 阅读(539) 评论(0) 推荐(0) 编辑