Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".字符串相加,不难个人思路:1,尾部对齐,然后逐位相加,flag记为进位代码: 1 #inclu...
分类:
其他好文 时间:
2014-09-09 15:26:58
阅读次数:
213
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-09-09 15:11:38
阅读次数:
140
---慢慢地go through冈萨雷斯的DIP和配套的matlab,记下一些零碎的知识点给自己以后复习。DIP CH03 亮度变换与空间滤波矩阵A=[1,2,3;4,5,6]sum(A,1)对A的第一个维度求和,sum(A,2)对A的第二个维度求和;prod(A,n),max(A,n),min(A...
分类:
其他好文 时间:
2014-09-09 15:06:48
阅读次数:
239
Alternating Sum
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is a digit string S with infinite length. In addition, S is periodic and it can be formed by concatenating infinite re...
分类:
其他好文 时间:
2014-09-09 13:28:48
阅读次数:
210
Alternating Sum
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is a digit string S with infinite length. In addition, S is periodic and it can be formed by concatenating infinite repeti...
分类:
其他好文 时间:
2014-09-09 13:10:58
阅读次数:
164
题意:要求设计这样一个数据结构,支持下列操作1.add(x,y,a).对二维数组的第x行,第y列加上a.2.sum(l,b,r,t).求所有满足l0;x-=lowbit(x)){for(inty=j;y>0;y-=lowbit(y)){result+=C[x][y];}}returnresult;}...
分类:
其他好文 时间:
2014-09-09 12:00:58
阅读次数:
160
http://acm.hdu.edu.cn/showproblem.php?pid=4991用f[i][j]表示前i个数以第i个数结尾的合法子序列的个数,则递推式不难写出:f[i][j] = sum(f[k][j - 1]);其中k 2 #include 3 #include 4 #inclu...
分类:
其他好文 时间:
2014-09-09 11:08:58
阅读次数:
284
SELECT pub_name, state,SUM(state) AS 总数 FROM publishers GROUP BY pub_name, stateHAVING SUM(state)>2GROUP BY多列分组:两列数据任意组合成唯一能标识此行的数据,分组后的聚合函数是对每一组的数据进行...
分类:
其他好文 时间:
2014-09-09 10:48:18
阅读次数:
224
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-09-09 10:44:48
阅读次数:
132