codeforces 508 E. Arthur and Brackets
题目链接:
http://codeforces.ru/problemset/problem/508/E
题意:
有n对括号,按顺序,给出每对括号长度的范围,输出一种情况。
限制:
1
思路:
贪心:能匹配的先匹配。
括号匹配问题,果断先思考用栈能不能做。
C++ Code...
分类:
其他好文 时间:
2015-01-29 19:37:50
阅读次数:
194
题意:
给出括号序列中每个右括号可能离对应左括号多远 求这个括号序列
思路:
记忆化搜索解决 用f[l][r]表示对于第l个左括号到第r个左括号区间最前面的左括号与其对应右括号的距离
状态只有n^2个 不用担心TLE
求f[l][r]的方法为 如果最前的左括号可以包住l+1~r个括号就尝试包起来 否则将l~r分治为l~x和x+1~r两个子问题
代码:
#include
#i...
分类:
其他好文 时间:
2015-01-29 14:40:38
阅读次数:
129
用了很一段时间的Modelsim,用TCL脚本仿真,开始注意起来它,看了些资料,有一个问题始终让我很困惑,那就是花括号 的用法,今天Google了一下,觉得有一点豁然了,记录一下。为了不让自己的翻译影响大家理解,先给出原文,再翻译一下。第一段:THE RULESQUARE BRACKETS are ...
分类:
其他好文 时间:
2015-01-28 08:25:01
阅读次数:
328
Emmet的前身是大名鼎鼎的Zen coding,如果你从事Web前端开发的话,对该插件一定不会陌生。它使用仿CSS选择器的语法来生成代码,大大提高了HTML/CSS代码编写的速度,比如下面的演示:Zen coding下的编码演示去年年底,该插件已经改名为Emmet。但Emmet不只改名,还带来了一...
分类:
Web程序 时间:
2015-01-27 10:39:39
阅读次数:
206
最近说好的要学做移动App,想来想去,还是先从基础搞起,先把失散多年的html捡捡。Emmet是vi的一个插件,它可以让我等更方便的编辑html。...
分类:
系统相关 时间:
2015-01-26 19:25:32
阅读次数:
193
题目:
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...
分类:
其他好文 时间:
2015-01-25 16:44:04
阅读次数:
136
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in t...
分类:
其他好文 时间:
2015-01-24 01:35:02
阅读次数:
173
【题目】
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" ar...
分类:
其他好文 时间:
2015-01-23 21:34:47
阅读次数:
181
Sublime Text 3常用插件安装(含Emmet插件指令介绍)
1、安装Package Control
2、安装插件Emmet
3、Emmet常用技巧...
分类:
其他好文 时间:
2015-01-23 16:23:56
阅读次数:
124
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2015-01-21 23:56:00
阅读次数:
280