码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ...
分类:其他好文   时间:2014-06-04 20:14:25    阅读次数:287
Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:其他好文   时间:2014-06-04 19:30:13    阅读次数:230
Add Binary
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".classSolution{public:stringaddBinary(stringa,st...
分类:其他好文   时间:2014-06-04 19:23:09    阅读次数:235
Plus One
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at...
分类:其他好文   时间:2014-06-04 19:19:52    阅读次数:185
后缀数组模板一份
1/******************2byzhuyuqi*3QQ:1113865149*4name:2-sat*5*6******************/78usingnamespacestd;9constintMAX=1000;10intr[MAX],*rank;11intwa[MAX],w...
分类:其他好文   时间:2014-06-03 11:38:57    阅读次数:194
UVA 10827 Maximum sum on a torus
算法入门经典训练指南88页练习::这道题只要把原矩阵扩大4倍,那么其跟最大子矩阵的题目就很类似,把二维转化成一维,求最大的序列和,不过这个序列的长度不能超过n。长度不能超过n? 那这道题又跟hdu 3415HDU 3415 Max Sum of Max-K-sub-sequence (单调队列) 1...
分类:其他好文   时间:2014-05-30 18:14:46    阅读次数:471
Sum Root to Leaf Numbers
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:其他好文   时间:2014-05-30 16:32:52    阅读次数:226
Max Points on a Line
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line./** * Definition for a point. * struct Point { * ...
分类:其他好文   时间:2014-05-30 16:27:19    阅读次数:238
Binary Tree Maximum Path Sum
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-05-30 16:10:54    阅读次数:185
Path Sum
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-05-30 15:18:35    阅读次数:246
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!