码迷,mamicode.com
首页 >  
搜索关键字:maximum sum subarray    ( 25087个结果
4Sum
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:其他好文   时间:2014-06-04 22:44:27    阅读次数:250
每天努力一点之SQL(二) count sum case when then group by
1.select sum(CASE WHEN A.[STATUS]=0 THEN 1 ELSE 0 end) as a1,sum(CASE A.[STATUS] WHEN 1 THEN 1 ELSE 0 end) as a2,sum(CASE A.[STATUS] WHEN 2 THEN 1 ELS...
分类:数据库   时间:2014-06-04 21:10:46    阅读次数:513
Minimum Path Sum
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:其他好文   时间:2014-06-04 20:57:08    阅读次数:360
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
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
Best Time to Buy and Sell Stock III
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:其他好文   时间:2014-05-30 16:19:05    阅读次数:320
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!