Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-07-10 11:24:15
阅读次数:
229
计算文件夹大小(get-childitem -path $folder -recurse| measure-object -property length -sum).sum/1mb#拷贝文件提示进度(脚本只对零散文件有效,如果有大型文件的话,进度显示不正确)$folder = "D:\Temp_d...
分类:
其他好文 时间:
2014-07-10 00:34:36
阅读次数:
392
1 /* 2 ID: neverchanje 3 PROG: TOJ2195 4 LANG: C++11 5 */ 6 #include 7 #include 8 using namespace std; 9 10 char cmd;11 int n,val;12 int main(){13 //....
分类:
其他好文 时间:
2014-07-10 00:08:56
阅读次数:
196
Given two binary strings, return their sum (also a binary string).
分类:
其他好文 时间:
2014-07-09 23:52:48
阅读次数:
383
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta...
分类:
其他好文 时间:
2014-06-28 08:17:11
阅读次数:
305
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
/ ...
分类:
其他好文 时间:
2014-06-28 07:31:28
阅读次数:
214
UVA 11426 - GCD - Extreme (II)
题目链接
题意:给定N,求∑i=ni=1∑jnj=1gcd(i,j)的值。
思路:lrj白书上的例题,设f(n) = gcd(1, n) + gcd(2, n) + ... + gcd(n - 1, n).这样的话,就可以得到递推式S(n) = f(2) + f(3) + ... + f(n) ==> S(n) = S...
分类:
其他好文 时间:
2014-06-28 00:01:04
阅读次数:
246
题目
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
...
分类:
其他好文 时间:
2014-06-27 23:53:21
阅读次数:
290
在比较操作(==,!=,>,=,<=),matches,算数操作(+,-,*,/ ,包含%,?,CASE)中,如果有一个操作数为空,那么结果为空。
COUNT_STAR ,不过滤null数据
CAST 操作:将一个null数据从一个数据类型转换到另一个数据类型,结果为空
AVG,MIN,MAX,SUM,COUNT :这几个操作将忽略空值
CONCAT :任意...
分类:
其他好文 时间:
2014-06-27 23:24:12
阅读次数:
304
感谢微信平台---一天一道算法题--每天多一点进步----其实今天我接下去补上的几题都来自---待字闺中 所以我就原封不动的将它的题目与分析搬过来了原题给定一个数组,我们可以找到两个不相交的、并且是连续的子数组A和B,A中的数字和为sum(A), B中的元素和为sum(B)。找到这样的A和B,满足s...
分类:
其他好文 时间:
2014-06-27 22:31:04
阅读次数:
342