题意如下: 给一个只包含‘[’,‘]’,‘(’,‘)’的字符串求最大的匹配数,匹配是指一个左括号和一个它右边的右括号匹配,这样一对匹配数是2. 该题是一道区间DP题,思想如下: 在处理区间[ l , r ]的时候,如果s[ l ]与s[ r ]相匹配,那么dp[ l ][ r ]=dp[ l + 1 ...
分类:
其他好文 时间:
2018-05-04 10:31:34
阅读次数:
167
Arrays Arrays are subscripted with an expression between square brackets ([ and ]). If the expression is an expression list (expr, expr ...) then the ...
分类:
编程语言 时间:
2018-04-19 14:02:35
阅读次数:
200
Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [ ...
分类:
其他好文 时间:
2018-04-16 20:34:45
阅读次数:
172
[抄题]: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i ...
分类:
其他好文 时间:
2018-03-18 22:28:03
阅读次数:
150
# [common] is integral section [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in "[::1]:80", "[ipv6-host... ...
分类:
其他好文 时间:
2018-03-05 15:34:38
阅读次数:
1347
【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 所给的li,ri是左括号从左到右的顺序给的。 (且注意长度是2 n 现在我们先把第一个左括号放在第1个位置。 然后考虑第二个位置。 如果这个位置能放右括号和第一个匹配(位置满足在1+l[i]..1+r[i]之间. 那么我们就在第 ...
分类:
其他好文 时间:
2018-02-02 21:56:59
阅读次数:
152
1:题目描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close ...
分类:
其他好文 时间:
2018-02-01 10:41:13
阅读次数:
123
URAL 1183 思路:区间dp,打印路径,详见http://www.cnblogs.com/widsom/p/8321670.html 代码: ...
分类:
其他好文 时间:
2018-01-29 15:37:09
阅读次数:
147
工欲善其事,必先利其器【顺序不分先后】: sublime、webstrom、HBuilder、DreamWeaver、Vim、notepad++、github的Atom软件、Adobe的开源软件brackets、EditPlus、VScode 当然对于前端开发而言:只要能满足你所要求的 都是好的编辑 ...
分类:
其他好文 时间:
2018-01-20 15:11:47
阅读次数:
208
Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b ...
分类:
其他好文 时间:
2018-01-16 14:02:06
阅读次数:
128