码迷,mamicode.com
首页 >  
搜索关键字:maximum    ( 4142个结果
Max Points on a Line
Max Points on a LineGivennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.c++版本:/** * Definition for a poi....
分类:其他好文   时间:2014-10-19 22:42:21    阅读次数:225
LeetCode Best Time to Buy and Sell Stock II
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-10-19 22:35:19    阅读次数:165
Leetcode | Maximum Product Subarray
Leetcode 加新题了Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array ...
分类:其他好文   时间:2014-10-19 15:36:04    阅读次数:251
POJ 2479 Maximum sum
题意:给你一个数列,求出数列中不相交的两个子段和,要求和最大。 Sol:对于每个i来说,求出 [ 0 ~ i-1 ] 的最大子段和以及 [ i ~ n-1 ] 的最大子段和,在加起来,求一个最大的就可以了。 [ 0 ~ i-1 ] 的最大子段和从左向右扫描 , [ i ~ n-1 ] 从右向左扫描。 复杂度O(n) #include #include using namespace ...
分类:其他好文   时间:2014-10-18 21:03:16    阅读次数:171
Maximum Depth of Binary Tree | LeetCode
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2014-10-18 20:57:37    阅读次数:229
HDu 2830 Matrix Swapping II(dp)
Problem Description Given an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as this ...
分类:移动开发   时间:2014-10-17 23:26:50    阅读次数:264
【LeetCode】Maximum Product Subarray 求连续子数组使其乘积最大
Add Date2014-09-23Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product....
分类:编程语言   时间:2014-10-17 00:33:53    阅读次数:316
Maximum number, GCD condition (codechef March Challenge 2014)
题目 :http://acm.bnu.edu.cn/v3/problem_show.php?pid=40489最近做到的一道蛮有意思的题目(codechef现在的题目确实很赞了)题意 :中文题面 (cc的一大好处就是有中文翻译,嘿嘿)区间Max = max{a_i|gcd(a_i, g) > 1 &...
分类:其他好文   时间:2014-10-16 23:35:33    阅读次数:307
4 Best Time to Buy and Sell Stock III_Leetcode
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet...
分类:其他好文   时间:2014-10-16 21:34:53    阅读次数:240
Maximum Product Subarray 求最大子数组乘积
这个求最大子数组乘积问题是由最大子数组之和问题演变而来,但是却比求最大子数组之和要复杂,因为在求和的时候,遇到0,不会改变最大值,遇到负数,也只是会减小最大值而已。而在求最大子数组乘积的问题中,遇到0会使整个乘积为0,而遇到负数,则会使最大乘积变成最小乘积,正因为有负数和0的存在,使问题变得复杂了不...
分类:编程语言   时间:2014-10-16 17:11:32    阅读次数:274
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!