Brackets SequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:25861Accepted:7281Special JudgeDescriptionLet us define a regular brackets sequ...
分类:
其他好文 时间:
2014-10-28 23:37:04
阅读次数:
173
Brackets SequenceTime Limit: 1000MSMemory Limit: 65536KSpecial JudgeDescriptionLet us define a regular brackets sequence in the following way: 1. Empt...
分类:
其他好文 时间:
2014-10-27 12:15:53
阅读次数:
222
Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets m...
分类:
其他好文 时间:
2014-10-26 22:31:27
阅读次数:
438
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 all val...
分类:
其他好文 时间:
2014-10-26 17:02:49
阅读次数:
142
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-10-25 14:18:46
阅读次数:
178
传送门@百度BracketsTime Limit: 1000MSMemory Limit: 65536KDescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty s...
分类:
其他好文 时间:
2014-10-24 20:44:58
阅读次数:
336
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
all va...
分类:
其他好文 时间:
2014-10-22 22:02:58
阅读次数:
227
题目地址:Ural 1183
终于把这题给A了。。。拖拉了好长时间,。。
自己想还是想不出来,正好紫书上有这题。
d[i][j]为输入序列从下标i到下标j最少需要加多少括号才能成为合法序列。0
c[i][j]为输入序列从下标i到下标j的断开位置,如果没有断开则为-1。
当i==j时,d[i][j]为1
当s[i]=='(' && s[j]==')' 或者 s[i]=='['...
分类:
其他好文 时间:
2014-10-22 11:07:30
阅读次数:
240
Problem:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the ...
分类:
其他好文 时间:
2014-10-19 01:16:41
阅读次数:
293
DP:
边界条件:dp[0][j] = 1递推公式:dp[i][j] = sum{dp[i-k][j] * dp[k-1][j-1] | 0
i对括号深度不超过j的,可以唯一表示为(X)Y形式,其中X和Y可以为空,设X有k-1对括号,则对应的方案数为dp[i-k][j] * dp[k-1][j-1]
Little Brackets
Time Limit: 2 S...
分类:
其他好文 时间:
2014-10-19 00:05:07
阅读次数:
220