题目:将给定的路径名简化,返回最简形式。
path = "/home/",
=> "/home"
path = "/a/./b/../../c/",
=> "/c"
虽然咋看起来比较杂乱,但还是比较整齐的,每个部分由‘/‘进行分割,就像文本处理中,由空格或tab分割的单词一样,对得到的不同的分割此进行不同的处理。得到的可能的分割词包括:
string simplifyP...
分类:
其他好文 时间:
2014-05-26 06:13:24
阅读次数:
213
线段树的单点更新,区域查询操作。
#include
#include
#include
#include
#include
using namespace std;
#define lmin 1
#define rmax n
#define lson l,(l+r)/2,rt<<1
#define rson (l+r)/2+1,r,rt<<1|1
#define root lmin,rmax,1...
分类:
其他好文 时间:
2014-05-26 05:25:50
阅读次数:
187
区域查询操作。
ma[i]:i区间内的最大值
mi[i]:i区间内的最小值
#include
#include
#include
#include
#include
using namespace std;
#define INF 99999999
#define lmin 1
#define rmax n
#define lson l,(l+r)/2,rt<<1
#define rson ...
分类:
其他好文 时间:
2014-05-26 04:11:41
阅读次数:
202
题目一:
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Fin...
分类:
其他好文 时间:
2014-05-26 04:06:41
阅读次数:
248
今天往工程里添加Log.h和Log.cpp这用来打印log的文件时, 编译报错误.
Log.cpp里的一些函数调用func1(), func2(), funcXXX()找不到实现, 可是那些函数明明在公共的接口库xxx.h和xxx.cpp里有声明和实现啊, 函数包含也没有问题.
问题排查 --> xxx.h里的函数声明都是static的, 很奇怪, 经对比, 只是我这个项目里这样, 其它项目...
分类:
其他好文 时间:
2014-05-26 03:58:26
阅读次数:
192
建筑群最长坡值
时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte
总提交:454 测试通过:168
描述
建筑群所有建筑高度分别为h1、h2…hN,可以得到一些单调递减的序列hi1、hi2…hiK,其长度称为建筑群的坡值,这里1≤i1<
i2≤N。
你的任务:对于给定的建筑群所有建筑高度,求...
分类:
其他好文 时间:
2014-05-26 03:45:57
阅读次数:
178
flag[i]:标记i这个区间的值。
val[i]:i这个区间的长度
#include
#include
#include
#include
#include
using namespace std;
#define INF 99999999
#define lmin 1
#define rmax n
#define lson l,(l+r)/2,rt<<1
#define rson (l+r...
分类:
其他好文 时间:
2014-05-26 03:37:19
阅读次数:
203
DataUml Design 代码模板完全基于C#语言来编写的。不懂写模板的可以请教作者,随时欢迎。下面是一段模板代码,这段代码可以获取一个类结构的所有信息。
#@ template language="C#" HostSpecific="True" #>
#
NetUmlTemplateCodeHost host =...
分类:
其他好文 时间:
2014-05-25 00:26:23
阅读次数:
312
int -> VALUE INT2NUM
VALUE -> int FIX2INT
char* -> VALUE rb_str_new(char*, len);
VALUE -> char* StringValueCString(value);
转换前..先 用 TYPE(v) 做类型转换
T_FIXNUM int
T_...
分类:
其他好文 时间:
2014-05-24 19:31:34
阅读次数:
214
Vs2010winform程序打包部署
1.新建安装部署项目
打开vs2010,选择文件->新建->项目->其他项目类型->安装和部署->选择安装项目。如下图:
2.开始制作
点击如上图中确定后进入项目开始制作:
2.1点击"应用程序文件夹"右击选择添加->文件夹或者双击"应用程序文件夹"在右边的空白处右击选择添加->文件夹。如下图:
2.2将自己开发项目中对应...