随笔分类 -  字符串

摘要:转自:http://blog.csdn.net/aozil_yang/article/details/77929216题意:告诉你一个字符串和k , 求这个字符串中有多少不同的子串恰好出现了k 次。思路:后缀数组。我们先考虑至少出现k 次的子串, 所以我们枚举排好序的后缀i (sa[i]) 。k段k 段的枚举。假设当前枚举的是 sa[i]~sa[i + k -1]那么假设这一段的最长公共前缀 是... 阅读全文
posted @ 2017-09-11 21:39 Pic 阅读(252) 评论(0) 推荐(0)
摘要:A SecretTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 256000/256000 K (Java/Others)Total Submission(s): 461 Accepted Submission(s): 182Problem DescriptionToday is the birthday of SF,so VS... 阅读全文
posted @ 2017-08-19 21:10 Pic 阅读(267) 评论(0) 推荐(0)
摘要:利用KMP的next数组的性质,我们可以找到next数组的循环节。 先说结论: 设字符串长n,则若其 i % ( i – next[n] ) == 0 ,则其有循环节(循环节数目大于1),其循环节数目为 i / ( i – next[n] ) 这里的next数组存储的是匹配到i匹配不成立时,下一个要 阅读全文
posted @ 2017-07-03 22:03 Pic 阅读(333) 评论(0) 推荐(0)
摘要:Time limit 2000 ms Memory limit 262144 kB Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got hold of lots of wooden cubes somewh... 阅读全文
posted @ 2017-04-12 22:08 Pic 阅读(605) 评论(0) 推荐(0)
摘要:Bill Total Value time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input input 阅读全文
posted @ 2016-10-16 14:42 Pic 阅读(210) 评论(0) 推荐(0)