uva 12012 Detection of Extraterrestrial
类型:KMP[经典]
题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3163
思路:枚举前缀,不断更新当前max值
字符串为周期串的条件是n % (n - next[n]) = 0
子串个数x为1时特殊考虑
数据: aba
答案:3 0
原创
2012-03-09 22:44:21 ·
350 阅读 ·
0 评论