随笔分类 -  回文树

摘要:题目 题意:判断一个字符串是否可以由三个回文串组成 题解:利用强大的回文树,计算出以每个字符为结尾的回文串,然后从字符串的最后一个字符开始,递归判断。 struct Tree { int next[4005][30]; int fail[4005]; int cnt[4005]; int num[4 阅读全文
posted @ 2021-02-15 11:53 Shendu.CC 阅读(110) 评论(0) 推荐(0) 编辑
摘要:"https://leetcode.com/problems/shortest palindrome/" 好题目啊! 题目: Given a string s, you are allowed to convert it to a palindrome by adding characters in 阅读全文
posted @ 2020-02-10 19:08 Shendu.CC 阅读(128) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示