题意: 求模板在匹配串所有子串中出现次数. SOL: 本题与普通kmp有一点不同,因为待匹配串中的模板串可能相互包含. 我们考虑正常的kmp是在怎么做的 i = 1 2 3 4 5 6 7 8 9 …… A = a b a b a b a a b a b … B = a b a b a c b j = 1 2 3 4 5 6 7 i=j=6时两个字符串不同了,那么j要减小到上一个匹配的地方. 当匹配完了呢? 比如 i = 1 2 3 4 5 6 A= a z a z a…
Oulipo Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7141 Accepted Submission(s): 2835 Problem Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, wit…