题意是给定一个字符串,求最少把它分成多少份,使的每一份都是回文串。 错了好多遍,最后发现是贪心思路出了问题,一开始求出dp[i][j],dp[i][j]表示第i个到第j个这段子串是否是回文串,求出来后,我直接从1开始遍历,每次求最右边的,这种贪心思路是有问题的。 看了赛后别人的才知道可以同动态规划, ...
分类:
其他好文 时间:
2017-08-03 18:47:42
阅读次数:
120
A - The Trip, 2007 小包可以放在打包里,求最少的数量。 做法就是求出现相同数字最多的。 B - Partitioning by Palindromes 传送 C - Seek the Name, Seek the Fame The little cat is so famous, ...
分类:
其他好文 时间:
2017-08-03 18:09:44
阅读次数:
130
Let's say nums is [10,11,...,19]. Then after nth_element and ordinary partitioning, we might have this (15 is my median): I rewire it so that the firs ...
分类:
其他好文 时间:
2017-07-14 23:56:14
阅读次数:
219
Partitioning is a general term used to describe the act of breaking up your logical data elements into multiple entities for the purpose of performanc ...
分类:
其他好文 时间:
2017-06-25 22:33:28
阅读次数:
325
Palindrome Partitioning Total Accepted: 21056 Total Submissions: 81036My Submissions Given a string s, partition s such that every substring of the pa ...
分类:
其他好文 时间:
2017-06-15 10:36:38
阅读次数:
184
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl ...
分类:
其他好文 时间:
2017-06-14 18:14:16
阅读次数:
120
I: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exa ...
分类:
其他好文 时间:
2017-06-09 19:24:32
阅读次数:
249
【题目】 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For e ...
分类:
其他好文 时间:
2017-05-27 17:58:45
阅读次数:
105
方法:使用深度遍历的方法,时间复杂度O(2^n) ...
分类:
其他好文 时间:
2017-05-20 16:31:40
阅读次数:
199
题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Exampl ...
分类:
其他好文 时间:
2017-05-17 22:09:47
阅读次数:
228