码迷,mamicode.com
首页 >  
搜索关键字:maximum sum subarray    ( 25087个结果
求一堆数组中最大的子数组
成员:周其范20112794 胡宝月20112827上课的时候老师布置了这个题目,初一看这个题目,我们讨论的时候就是在想,应该从第一个数开始,一个一个加,一直加到最后一个数,然后从第二个数开始,一个一个加,加到最后一个,以此类推,在比较的过程中,我们需要比较每加一次的数大小,把每比一次的数赋给sum...
分类:其他好文   时间:2014-06-03 09:53:07    阅读次数:243
linux shell设置颜色
使用echo或者printf时,可以添加输出文本的颜色设置echo -e "Maximum \e[1;31m" $max_threads "\e[0mthreads allowed!" >> $term_dir/summary或者printf("\033[;34mfile\033[0m")31开始代...
分类:系统相关   时间:2014-06-03 09:11:52    阅读次数:306
[leetcode]Max Points on a Line @ Python
原题地址:https://oj.leetcode.com/problems/max-points-on-a-line/题意:Givennpoints on a 2D plane, find the maximum number of points that lie on the same strai...
分类:编程语言   时间:2014-06-03 08:55:48    阅读次数:282
【HDOJ】1394 Minimum Inversion Number
逆序数的性质。1. 暴力解 1 #include 2 3 #define MAXNUM 5005 4 5 int a[MAXNUM]; 6 7 int main() { 8 int n; 9 int i, j, sum, min;10 11 while (scanf(...
分类:其他好文   时间:2014-05-31 07:50:50    阅读次数:170
Aizu 1335 Equal Sum Sets
DescriptionLet us consider sets of positive integers less than or equal ton. Note that all elements of a set are different. Also note that the order o...
分类:其他好文   时间:2014-05-31 05:12:49    阅读次数:246
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
Maximum Depth of Binary Tree
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-05-30 15:03:42    阅读次数:237
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-05-30 15:00:54    阅读次数:335
Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:其他好文   时间:2014-05-30 14:59:37    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!