题意:给出一个括号串,求最短的满足要求的括号串;思路:枚举长度,枚举起点和终点,找到匹配括号是可递推到子序列,枚举中间指针求最优解;打印时通过记忆表path存储最优解,递归求出最短序列;#include#include#include#define INF 0x7fffffffusing names...
分类:
其他好文 时间:
2015-06-13 21:33:32
阅读次数:
114
for array 循环数组循环使用案例定义数组数据var data = { names: ["Maradona","Pele","Ronaldo","Messi"] }模版中使用{{for names}} {{: #index+1}}. {{: #data}} {{/for...
分类:
Web程序 时间:
2015-06-13 15:42:02
阅读次数:
354
1.一个简单的代码function s(names){this.name=names;this.showname=functoin(){ alert(this.name);}} //工厂方式new s("张三").showname(); // 函数中 'this' 的理解
分类:
编程语言 时间:
2015-06-11 16:40:41
阅读次数:
113
awk使用字段操作符$来指定字段。在该操作符后面跟着一个数字或变量,用于标识字段的位置。"$1" 表示第一个字段, "$2" 表示第二个字段等等。"$0 "表示整个输入记录。下面的例子显示了第一个字段是姓,第二个字段是名字,后面是电话号码。
$ awk '{ print $2,$1,$3 }' names
Robinson John 666-555-1111
$1表示名字, ...
分类:
其他好文 时间:
2015-06-10 22:37:59
阅读次数:
144
swift reversed = sorted(names, { (s1: String, s2: String) -> Bool in return s1 > s2 }) java8 list.sort((a, b) -> { Integer.compare(a.length(),b.length() }); C++ sort(x,x + N,[](float a, float b) { ...
分类:
编程语言 时间:
2015-06-09 17:54:47
阅读次数:
138
这里是jQuery代码$(function () { $("input[name=names]").click(function () { //获得所有的name=names的input,并给他们添加click监听事件 var arr...
分类:
Web程序 时间:
2015-06-08 21:21:03
阅读次数:
109
# Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry shoul...
分类:
其他好文 时间:
2015-06-08 10:06:36
阅读次数:
880
Yes, you are developing a ‘Love calculator’. The software would be quite complex such that nobody could crack the exact behavior of the software.So, given two names your software will generate the perc...
分类:
其他好文 时间:
2015-06-08 09:51:44
阅读次数:
100
create or replace function Fuc_Get_AuthorName(RecID_In in varchar2, AdmID_In in varchar2) return varchar2 is Result varchar2(8000); names varchar2(4.....
分类:
数据库 时间:
2015-06-06 11:56:53
阅读次数:
120