码迷,mamicode.com
首页 >  
搜索关键字:动态规划    ( 6061个结果
LeetCode--Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest...
分类:其他好文   时间:2015-01-15 22:12:45    阅读次数:169
[C++]LeetCode: 96 Maximum Product Subarray(动态规划)
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the l...
分类:编程语言   时间:2015-01-15 13:02:10    阅读次数:229
LeetCode--Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
分类:其他好文   时间:2015-01-15 09:30:17    阅读次数:172
LeetCode--Best Time to Buy and Sell Stock II
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 complete as many transactions as you like (ie, buy on...
分类:其他好文   时间:2015-01-15 09:27:56    阅读次数:187
LeetCode--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 following triangle [ [2], [3,4], [...
分类:其他好文   时间:2015-01-14 22:53:47    阅读次数:153
0-1背包的动态规划算法,部分背包的贪心算法和DP算法------算法导论
一、问题描述0-1背包问题,部分背包问题。分别实现0-1背包的DP算法,部分背包的贪心算法和DP算法。二、算法原理(1)0-1背包的DP算法 0-1背包问题:有n件物品和一个容量为W的背包。第i件物品的重量是w[i],价值是v[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价....
分类:编程语言   时间:2015-01-14 00:42:06    阅读次数:225
Dynamic programming:from novice to advanced【动态规划】
动态规划从入门到高阶,个人感觉值得一看!!...
分类:其他好文   时间:2015-01-13 21:45:50    阅读次数:319
hdu 2059 龟兔赛跑(DP)
题目意思: http://acm.hdu.edu.cn/showproblem.php?pid=2059 题目没有说明白的是,不能用电动车剩余的能力,每次都要充满。 题目分析: 动态规划问题,可以对站点进行DP,加上起点和终点一共有n+2个站,起点表示站点0,dp[n+1]就是乌龟的最优时间,即最短时间,那么动态转化方程为:dp[i]=min(dp[i],dp[j]+t1); ...
分类:其他好文   时间:2015-01-13 19:58:24    阅读次数:159
常见算法问题的分类
常见算法问题的分类...
分类:编程语言   时间:2015-01-13 19:56:31    阅读次数:210
LeetCode--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,?5,4], the contiguous subarray [4,?1,2,1] ha...
分类:其他好文   时间:2015-01-12 13:07:22    阅读次数:149
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!