KMP处理字符串
While.True
这个作者很懒,什么都没留下…
展开
-
Seek the Name, Seek the Fame (KMP&&哈希)
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 ...原创 2018-08-19 09:30:37 · 1195 阅读 · 0 评论 -
Number Sequence (KMP)
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K ...原创 2018-08-19 09:33:14 · 247 阅读 · 0 评论 -
剪花布条 (KMP)
一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input 输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。 Output 输...原创 2018-08-19 09:49:38 · 203 阅读 · 0 评论 -
Cyclic Nacklace (KMP & next的灵活运用)
CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to...原创 2018-08-19 09:57:05 · 295 阅读 · 0 评论 -
Period (KMP & next数的运用)
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 (...原创 2018-08-19 10:05:08 · 196 阅读 · 0 评论 -
Power Strings (KMP & next数的运用)
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-...原创 2018-08-19 10:09:47 · 157 阅读 · 0 评论