1、题目Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For exam...
分类:
编程语言 时间:
2014-11-04 06:40:34
阅读次数:
260
Determine whether an integer is a palindrome. Do this without extra space.要求是不能使用额外的空间,言下之意就是不能先转化成字符串来进行处理,所以得想另外一种办法。额外考虑:负数属于回文数字?思路:直接来截取最低位和最高位来进...
分类:
其他好文 时间:
2014-11-03 22:26:57
阅读次数:
246
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2014-11-03 22:26:42
阅读次数:
304
Palindrome
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 53647
Accepted: 18522
Description
A palindrome is a symmetrical string, that is, a string read ide...
分类:
其他好文 时间:
2014-11-01 17:50:47
阅读次数:
179
这个题是走弯路了,刚开始自己DP出了方程,无限MLE,唉
if(s1[i]==s1[j])
dp[i][j]=dp[i+1][j-1];
else dp[i][j]=min(dp[i][j-1],dp[i+1][j]) +1;
后来百度了一下,这个原来是个经典回文串问题,即先将串置反,然后求LCS........
然后就是这题卡时间卡的特别厉害,多用了一次strlen就TLE...
分类:
其他好文 时间:
2014-11-01 16:23:19
阅读次数:
146
1.快速排序
快速排序是不稳定的排序算法,平均时间复杂度O(nlgn)。快速排序是利用了partition( )进行排序的。partition( )有两种实现形式,(1)利用两个指针一个头指针,一个尾指针,通过交换头尾指针所指的数进行排序; (2)一前一后两个指针同时从左往右进行遍历,如果前指针所遇到的数比主元小,则后指针右移一位,然后交换。Partition方法还可以用在很多地...
分类:
编程语言 时间:
2014-10-31 23:43:47
阅读次数:
380
使用Spark有一段时间了,现在记录spark调优的一些经验。1.textFile的minparitition,只是设置最小的partition数目,下界(比如3),当数据量大的时候,改参数不起作用。可以尝试设置成10002. reduceByKey的并行度,也就是reduce的数目。 2.1 s....
分类:
其他好文 时间:
2014-10-31 23:30:55
阅读次数:
326
PartitionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2472Accepted Submission(s): 978Problem De...
分类:
其他好文 时间:
2014-10-31 20:35:31
阅读次数:
244
/*H - 简单dp 例题扩展Time Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA palindrome is a symmetrical strin...
分类:
其他好文 时间:
2014-10-31 20:33:20
阅读次数:
134
D - Palindrome Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice URAL 1297DescriptionThe “U.S. Robots” HQ has...
分类:
编程语言 时间:
2014-10-30 22:28:49
阅读次数:
295