随笔分类 -  后缀数组

《挑战程序设计竞赛》 利用后缀数组求最长回文串
摘要:问题:求一个字符串的最长回文子串。 解决方案:利用后缀数组,设这个字符串是S,S'是这个字符串的反转,设T=S+'$'+S',则所有的回文子串一定会出现在字符串T当中的其中两个后缀的前缀上,所以只要求T的lcp,利用lcp求后缀之间的相同前缀的最大长度。 代码参考: 阅读全文

posted @ 2018-05-29 11:05 ZefengYao 阅读(355) 评论(0) 推荐(0)

poj 3729 Facer’s string
摘要:Facer’s string Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 2155 Accepted: 644 Description Minifacer was very happy these days because h 阅读全文

posted @ 2018-05-22 14:09 ZefengYao 阅读(210) 评论(0) 推荐(0)

poj 3415 Common Substrings
摘要:Common Substrings Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 12585 Accepted: 4228 Description A substring of a string T is defined as: 阅读全文

posted @ 2018-05-20 20:14 ZefengYao 阅读(129) 评论(0) 推荐(0)

poj 1509 Glass Beads
摘要:Glass Beads Time Limit: 3000MS Memory Limit: 10000K Total Submissions: 4868 Accepted: 2749 Description Once upon a time there was a famous actress. As 阅读全文

posted @ 2018-05-20 19:26 ZefengYao 阅读(136) 评论(0) 推荐(0)

导航