题意给出一个合法的小括号序列,然后有三种操作:
L 光标左移
R 光标右移
D 删除当前位置括号并他的对应括号,两括号中间的也一起删除。
输出操作后的序列。思路list直接模拟就好了,这题主要考察的也就是list的操作吧。
list的删除也确实是个坑,注意光标移动出界之后别忘了向左移动一下。代码#include
#include
#include...
分类:
其他好文 时间:
2016-05-07 06:55:27
阅读次数:
123
一、Ubuntu中软件安装方法
1、APT方式
(1)普通安装:apt-get install softname1 softname2 …;
(2)修复安装:apt-get -f install softname1 softname2... ;(-f Atemp to correct broken dependencies)
(3)重新安装:apt-get --reinstal...
分类:
系统相关 时间:
2016-05-06 15:19:15
阅读次数:
196
E. Correct Bracket Sequence Editor Recently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as C ...
分类:
其他好文 时间:
2016-05-06 08:10:54
阅读次数:
299
Read/write permissions Unfortunately, TestLink scripted setup cannot continue at the moment, due to the above 2 errors. Please correct the errors, and ...
分类:
系统相关 时间:
2016-04-21 10:03:05
阅读次数:
821
Error Correct System Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 527B Error Correct System ...
分类:
其他好文 时间:
2016-04-20 23:23:53
阅读次数:
347
题目:
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
m2eclipse has moved from sonatype to eclipse. The correct update site is http://download.eclipse.org/technology/m2e/releases/ If this is not working, ...
分类:
系统相关 时间:
2016-04-06 15:13:06
阅读次数:
160
A common typing error is to place the hands on the keyboard one row to the right of the correct position. So ‘Q’ is typed as ‘W’ and ‘J’ is typed as ‘ ...
分类:
其他好文 时间:
2016-04-05 19:31:31
阅读次数:
158
原题链接在这里:https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree/ 题目: Given an array of numbers, verify whether it is the correct ...
分类:
其他好文 时间:
2016-03-28 07:08:30
阅读次数:
140
题目:
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