这两道题用递归的解法都很简单,只是稍有不同。下面是AC代码: 1 /** 2 * Given a
binary tree, find its minimum depth. 3 * the minimum depth is the number of
nodes along th...
分类:
其他好文 时间:
2014-05-10 08:47:32
阅读次数:
271
1 /* 2
题意:给出0~59的一排数字表示某一时刻出现了1辆bus,其中数字重复出现表示多辆bus同时出现,这些bus是 3
由多个bus线路组成的,每条线路都有一个时间间隔,而且同一线路的bus在0~59肯定会出现两次或以上,如果 4
有两条线路的间隔相同且到达时刻相同也算作两条不同...
分类:
其他好文 时间:
2014-05-10 02:14:42
阅读次数:
355
Given two wordsword1andword2, find the minimum
number of steps required to convertword1toword2. (each operation is counted as 1
step.)You have the fol...
分类:
其他好文 时间:
2014-05-10 01:09:28
阅读次数:
325
Given two words word1 and word2, find the
minimum number of steps required to convert word1 to word2. (each operation is
counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-05-09 19:09:35
阅读次数:
318
// test.cpp : Defines the entry point for the
console application.//#include "stdafx.h"#include #include #include
"winioctl.h"#define IOCTL_STORAGE_QU...
分类:
其他好文 时间:
2014-05-05 10:52:44
阅读次数:
370
linux系统下.vimrc文件(这个文件可以在家目录新建);这个文件记录着vim的配置信息;如:"显示行号set
number"键映射map“如按F5,在word的前后加入{}map i{ea}
分类:
其他好文 时间:
2014-05-05 10:12:32
阅读次数:
274
这个题目我敲了一个简单的EK,这不是难点难点在于建图,按题目的要求
每个猪圈和顾客都建点的话,那也太多了。。。我看了Edelweiss里面的缩点方法才建好的图,哎,惭愧啊实际那些猪圈根本不需要单独建点,猪圈无非就是向顾客输送流量
以及向同时开着的猪圈输送流量,这一步可以直接缩为,当某个猪圈被第一次打...
分类:
其他好文 时间:
2014-05-05 09:52:56
阅读次数:
346
typeof用以获取一个变量或者表达式的类型,typeof一般只能返回如下几个结果:number,boolean,string,function(函数),object(NULL,数组,对象),undefined。如:alert(typeof
(123));//typeof(123)返回"number...
分类:
其他好文 时间:
2014-05-05 09:37:22
阅读次数:
435
We consider permutations of the numbers 1,..., N
for some N. By permutation we mean a rearrangment of the
number 1,...,N. For example
2 4 5 1 7 6 3 8
is a permutation of 1,2,...,8. Of cours...
分类:
其他好文 时间:
2014-05-04 18:38:14
阅读次数:
341