字符串
cwb丶
这个作者很懒,什么都没留下…
展开
-
kmp 算法回顾(Number Sequence HDU - 1711 )
给定两个数字序列a[]和b[],b[]有可能整体作为一个连续子序列出现在了a[]中,现在请你找出b[]在a[]中第一次出现的位置(起始位置从 1 开始计数),如果一次都没有出现,请输出 -1。 输入格式 第一行包含一个数字 T,表示测试用例的个数。 对于每组测试用例,第一行包含两个数字 n m ( 1<= n <= 1000000, 1 <= m &l...原创 2019-08-26 20:21:46 · 120 阅读 · 0 评论 -
Period(循环节 nxt数组的应用)
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 ...原创 2019-08-27 14:11:02 · 248 阅读 · 0 评论 -
Power Strings(求循环次数最多的循环节 kmp)
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-...原创 2019-08-27 21:07:18 · 318 阅读 · 0 评论 -
Seek the Name, Seek the Fame POJ - 2752 (nxt数组应用)
The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek th...原创 2019-08-27 21:12:25 · 120 阅读 · 0 评论 -
ac自动机模板 hdu2222
In the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wiskey also wants to bring this feature to his image retrieval system. Every image have a long description,...原创 2019-08-31 14:57:11 · 472 阅读 · 0 评论