![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
文章平均质量分 76
macans
止步就是退步
展开
-
LeetCode------------palindrome-partitioningII(回文2)
题目描述Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s原创 2016-10-05 16:09:49 · 321 阅读 · 0 评论 -
LeetCode:word-break
题目描述Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens ="leetcode",原创 2016-09-27 12:37:13 · 419 阅读 · 0 评论 -
LeetCode:word-breakII
题目描述Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For examp原创 2016-10-06 09:10:48 · 256 阅读 · 0 评论 -
LeetCode--------candy
题目描述There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must原创 2016-10-06 19:39:03 · 444 阅读 · 0 评论 -
字符串排列
编写一个方法,确定某字符串的所有排列组合。给定一个string A和一个int n,代表字符串和其长度,请返回所有该字符串字符的排列,保证字符串长度小于等于11且字符串中字符均为大写英文字符,排列中的字符串按字典序从大到小排序。(不合并重复字符串)测试样例:"ABC"返回:["CBA","CAB","BCA","BAC","ACB","ABC"]--原创 2016-12-11 16:04:00 · 559 阅读 · 0 评论 -
有趣的数-CCF模拟题4
问题描述我们把一个数称为有趣的,当且仅当:1. 它的数字只包含0, 1, 2, 3,且这四个数字都出现过至少一次。2. 所有的0都出现在所有的1之前,而所有的2都出现在所有的3之前。3. 最高位数字不为0。因此,符合我们定义的最小的有趣的数是2013。除此以外,4位的有趣的数还有两个:2031和2301。请计算恰好有n位的有趣的数的个数。由于答案可能非常大,只需要输出答案除以100000000原创 2016-12-15 17:55:16 · 492 阅读 · 0 评论 -
文本比较算法Ⅱ——Needleman/Wunsch算法
在“文本比较算法Ⅰ——LD算法”中介绍了基于编辑距离的文本比较算法——LD算法。 本文介绍基于最长公共子串的文本比较算法——Needleman/Wunsch算法。 还是以实例说明:字符串A=kitten,字符串B=sitting 那他们的最长公共子串为ittn(注:最长公共子串不需要连续出现,但一定是出现的顺序一致),最长公共子串长度为4。 定义转载 2017-04-03 21:44:07 · 814 阅读 · 0 评论