k***e 发帖数: 556 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: krone (krone), 信区: JobHunting
标 题: 讨论个subarray sum的变种问题
发信站: BBS 未名空间站 (Sun Nov 29 09:27:08 2009, 美东)
input: a circular array
output: a subvector of the array that has max sum
可以想象排列在圆周上的n个元素,求连续的k个使得其和最大
我的想法是
1. take any element as the leader and break the circle into one dimensional
array a[1:n]. use the classical method to get the maxsum subvector
2. we did not consider the case that the maxsum subvector in the circle
passes a[1]. in the next step we will fig |
k***e 发帖数: 556 | 2 贴在jobhunting没人理我。知道这里大牛多,所以。。。 |
m********0 发帖数: 2717 | 3 呵呵,还是没人理你,我觉得大牛都在jobhunting。这里人都不爱讨论算法题,鄙视编程。 |
w*****e 发帖数: 197 | 4 Why not DP? You just need to be a little bit careful
with the calculation, but nothing really changes here.
dimensional
【在 k***e 的大作中提到】 : 贴在jobhunting没人理我。知道这里大牛多,所以。。。
|