输出一个串里面能匹配的括号数 状态转移方程: if(s[i]=='('&&s[j]==')'||s[i]=='['&&s[j]==']') dp[i][j]=dp[i+1][j-1]+2; 然后再区间合并 ...
分类:
其他好文 时间:
2016-05-10 12:42:58
阅读次数:
186
题意:给定一个由'(', ')', '[', 和 ']' 组成的序列,找出以该序列为子序列的最短合法序列。
定义合法的括号序列如下:
1 空序列是一个合法的序列
2 如果S是合法的序列,则(S)和[S]也是合法的序列
3 如果A和B是合法的序列,则AB也是合法的序列
例如:下面的都是合法的括号序列
(), [], (()), ([]), ()[], ()[()]
下...
分类:
其他好文 时间:
2016-05-06 12:58:45
阅读次数:
125
http://blog.csdn.net/libin56842/article/details/9673239 http://www.cnblogs.com/ACMan/archive/2012/08/09/2630497.html http://blog.csdn.net/chaiyuan414/ ...
分类:
其他好文 时间:
2016-05-03 12:39:07
阅读次数:
148
Vanya and Brackets Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 552E Vanya and Brackets Sub ...
分类:
其他好文 时间:
2016-04-24 21:40:46
阅读次数:
233
题目:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are...
分类:
其他好文 时间:
2016-04-17 23:17:34
阅读次数:
242
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the ...
分类:
其他好文 时间:
2016-04-15 15:21:29
阅读次数:
129
Brackets Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 29236 Accepted: 8319 Special Judge Description Let us define a regular br ...
分类:
其他好文 时间:
2016-04-10 17:54:44
阅读次数:
191
题目地址:Ural 1183 最终把这题给A了。。。拖拉了好长时间,。。 自己想还是想不出来,正好紫书上有这题。 d[i][j]为输入序列从下标i到下标j最少须要加多少括号才干成为合法序列。0<=i<=j<len (len为输入序列的长度)。 c[i][j]为输入序列从下标i到下标j的断开位置。假设 ...
分类:
其他好文 时间:
2016-04-07 18:26:01
阅读次数:
225
题目:http://poj.org/problem?id=1141 区间DP + 构造出DP的解 ...
分类:
其他好文 时间:
2016-03-31 16:36:23
阅读次数:
166
题目:
Given a string containing just the characters , determine if the input string is valid.The brackets must close in the correct order, “()” and “()[]{}” are all valid but “(]” and “([)]” are not.翻译:...
分类:
其他好文 时间:
2016-03-24 14:49:05
阅读次数:
135