![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP&AC自动机
文章平均质量分 77
tanmlh
这个作者很懒,什么都没留下…
展开
-
HDU 3746
Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3931 Accepted Submission(s): 1768 Problem Description CC always原创 2015-07-28 17:23:02 · 569 阅读 · 0 评论 -
The Minimum Length KMP
The Minimum Length Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu Submit Status Description There is a string A. The length of A is less than 1,000,000. I原创 2015-07-29 11:49:14 · 383 阅读 · 0 评论 -
POJ 1961
Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 14503 Accepted: 6892 Description For each prefix of a given string S with N characters (each charact原创 2015-07-29 11:20:05 · 364 阅读 · 0 评论 -
HDU 4468
Spy Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 539 Accepted Submission(s): 262 Problem Description “Be subtle! Be subtle! A原创 2015-08-26 22:45:39 · 562 阅读 · 0 评论 -
KMP && AC自动机模板
KMP: 获得next数组: void getNext() { nxt[0] = -1; for(int i = 1; i < n; i++) { int p = nxt[i-1]; for(; p != -1 && str[p+1] != str[i]; p = nxt[p]); p = str[p+1] == str[原创 2015-08-27 23:19:30 · 307 阅读 · 0 评论 -
HDU 2296
思路: 开个结构体,dp[i][j]记录从i号节点开始走j步能得到的最大的权值,以及走到最大权值的方案,还有答案,每次枚举能走到的所有点,更新答案,如果答案一样就选择字典序小的一个。也可以只记录走到该节点的父亲节点,这样每次答案一样时选字典小的就通过不断回退来确定。 #include #include #include #include #include #include原创 2015-08-29 15:46:40 · 272 阅读 · 0 评论 -
codeforces 30E 蓝桥杯 Tricky and Clever Password
算法训练 Tricky and Clever Password 时间限制:2.0s 内存限制:256.0MB 问题描述 在年轻的时候,我们故事中的英雄——国王 Copa——他的私人数据并不是完全安全地隐蔽。对他来说是,这不可接受的。因此,他发明了一种密码,好记又难以破解。后来,他才知道这种密码是一个长度为奇数的回文串。 Copa 害怕原创 2016-02-18 11:20:47 · 3028 阅读 · 0 评论