题意:给你一个字符串,问你其中不重叠的回文字串对有多少解题思路:这题用到两种方法,不过其实是一个很巧妙的二重dp1)暴力求解以i开头,j结尾的是否为回文,如果是,ans += sum[i-1](ans 为答案, sum[i]为在 1 - i内回文串的个数--需要dp求解)这里非常耗时,时间大约为 n...
分类:
其他好文 时间:
2014-07-30 20:05:44
阅读次数:
276
题目:
Product
The Problem
The problem is to multiply two integers X, Y. (0250)
The Input
The input will consist of a set of pairs of lines. Each line in pair contains one mu...
分类:
其他好文 时间:
2014-07-29 18:03:42
阅读次数:
283
Mapping the Swaps Sorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in t...
分类:
移动开发 时间:
2014-07-29 12:38:06
阅读次数:
212
一、题目DescriptionThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that ?The friends of...
分类:
其他好文 时间:
2014-07-27 22:32:29
阅读次数:
278
Problem IFRIENDSThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that ?The friends o...
分类:
其他好文 时间:
2014-07-27 22:31:29
阅读次数:
255
Problem DescriptionThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that “The friend...
分类:
其他好文 时间:
2014-07-27 22:26:19
阅读次数:
199
Surprising Strings
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 5783
Accepted: 3792
Description
The D-pairs of a string of letters are the ordered pai...
分类:
其他好文 时间:
2014-07-23 20:59:05
阅读次数:
288
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.http....
分类:
编程语言 时间:
2014-07-23 12:01:06
阅读次数:
330
题目如下:
Mapping the Swaps
Sorting an array can be done by swapping certain pairs of adjacent entriesin the array. This is the fundamental technique used in the well-knownbubbl...
分类:
移动开发 时间:
2014-07-16 17:08:59
阅读次数:
252
pairs
Returns three values: the next function, the table t, and nil, so that the
construction
for k,v in pairs(t) do body end
will iterate over all key–value pairs of table t.
See functi...
分类:
其他好文 时间:
2014-07-14 18:39:58
阅读次数:
317