搜索资源列表
bulldozer
- 动态规划求解:第一行包含两个数R 和C ( 2 ≤ R,C ≤ 1500 )为矩形地块的长和宽。接下来有R 行,每行有C 个用空格隔开的字符串,字符串要么以A 开头(表示 苹果),要么以B 开头(表示香蕉),后面接一个不超过99 的整数,表示对应的树木的数量。-Dynamic Programming: The first line contains two numbers R and C (2 ≤ R, C ≤ 1500) for the rectangular block of lengt
MaxSum-(2)
- 用动态规划算法实现最大m子段和问题,给定N个整数组成的序列,以及一个正整数m,要求确定序列的m个不相交子段,使这m个子段的总和达到最大-Dynamic programming algorithm with the maximum m sub-section and the problem, given a sequence of N integers, and a positive integer m, required to determine the sequence of m disjoi
DP
- 动态规划问题。给定一个整数的二维数组,由其中若干邻近元素构成的矩形称为子数组。 编程计算所有子数组元素之和的最大值。输入为整数n,及n^2个数,输出为所有子数组元素之和的最大值-Dynamic programming problem.Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater l
0-1-backpack
- 本代码提供0-1背包问题的动态规划解法,适用于背包容量是整数类型-The code provides 0-1 knapsack problem dynamic programming solution for the backpack capacity is an integer type
TSP
- Traveling Salesman Problem 市场上有很多种商品,旅行商 Shrek 做短期买卖赚取差价。他从一个城市购买一件商品,到达下一个相邻的城市就卖掉。如果这一次买卖无利可图,那么他就不会这么走。凭着自己和同伴多年的经验,他已经对地图上 n 个城市之间的差价了如指掌。两城市间可能有多种商品可赚取差价,此时 Shrek 只好倒卖利润最大的一件商品。 现在请你帮 Shrek 规划一条路线,使他能赚最多的钱。 输入 第一行两个整数 n、m。表示有 n 个城市,编号