这个题目思路:在一个bool型数组中,像接力一样传递匹配成功,传递到最后一个字符,说明匹配成功。说的明白点就是从第i(0~n)个字符开始向后与子串进行匹配,匹配的数组中标记为true,循环比较。需要注意的是:unordered_set的count(T s)查看是否包含该元素。string类的subs...
分类:
其他好文 时间:
2014-08-25 22:46:55
阅读次数:
260
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon...
分类:
其他好文 时间:
2014-08-25 11:47:54
阅读次数:
172
Clustered Index: Clustered index defines the way in which data is ordered physically on the disk. And there can only be one way in which you can order...
分类:
其他好文 时间:
2014-08-24 20:46:13
阅读次数:
270
Longest Palindromic Substring
Total Accepted: 17474 Total
Submissions: 84472My Submissions
Given a string S, find the longest palindromic substring in S. You may assume that the maximum l...
分类:
其他好文 时间:
2014-08-24 16:46:02
阅读次数:
190
Longest Substring Without Repeating Characters
Total Accepted: 20506 Total
Submissions: 92223My Submissions
Given a string, find the length of the longest substring without repeating char...
分类:
其他好文 时间:
2014-08-23 21:42:21
阅读次数:
359
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-08-23 21:35:21
阅读次数:
264
题意 输入一个城市的滑雪地图 你可以从高的地方滑到伤下左右低的地方 求这个城市的最长滑雪线路长度 即在一个矩阵中找出最长递减连续序列
令d[i][j]为以格子map(i,j)为起点的最长序列 则有状态转移方程d[i][j]=max{d[a][b]}+1 a,b为与i,j相邻且值比i,j小的所有点
#include
#include
#include
using na...
分类:
其他好文 时间:
2014-08-23 11:25:20
阅读次数:
245
链接:http://poj.org/problem?id=2954TriangleTime Limit:1000MSMemory Limit:65536KTotal Submissions:5043Accepted:2164DescriptionAlattice pointis an ordered...
分类:
其他好文 时间:
2014-08-22 17:44:29
阅读次数:
214
题目链接Longest Common SubstringTime Limit: 8000/4000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4077Accepted Submissio...
分类:
其他好文 时间:
2014-08-22 12:15:16
阅读次数:
330
LCS stands for longest common subsequence, and it is a well known problem. A sequence in thisproblem means a list of integers, and a sequence X is con...
分类:
其他好文 时间:
2014-08-22 00:14:45
阅读次数:
303