英语翻译However,for the gold version of the problem this is not

问题描述:

英语翻译
However,for the gold version of the problem this is not enough.We'll use the same basic structure for the new solution but we'll be able to bring the runtime down to O(N log N) using two observations.
First,we can maintain which sections of the array correspond to different hmax terms (hmax from the solution above) efficiently as we iterate over the books.When we move past book i the set of positions with hmax H[i] is exactly those with hmax no larger than H[i] when we were at i-1.As hmax is non-increasing with j we can simply keep a list of the intervals of books with the same hmax and update the list by merging the intervals with hmax
不管你是机器翻译的还是人工的,请至少自己看懂……
1个回答 分类:英语 2014-11-03

问题解答:

我来补答
然而,对于黄金版的问题这是不够的.
我们将使用相同的基本结构为新解决方案,但我们能使运行时到O(N,log,N)使用两个观测.
首先,我们可以维持的哪些部分阵列对应于不同的hmax术语(hmax从以上的解决办法)的效率是我们迭代的书.
当我们搬过去的书我设置的位置和hmax H[我]正是那些hmax不大于H[我]当我们在i-1.
作为hmax是non-increasing j我们可以简单的列表保留间隔的书籍与相同的hmax和更新列表合并的片段与hmax < = H[我]我们刚才创建的间隔.
因为两个indicies永远无法“unmerged”,是我们能做的最多n - 1合并操作算法的过程.
我们还必须注意消除indicies从第一个间隔如果wsum术语太大.
第二步是,C(x)是non-decreasing.
这是我们无法得到书架较小的高度通过添加更多的书.
这意味着我们应该只考虑一个时间间隔的书籍,开始在前一步中形成的.
因此我们每一次改变组间隔我们清除任何旧的成本从一个排序集初始元素和插入任何新的成本.
然后C(x)仅仅是最小的元素在这集.以下是我如何解决这个问题的.
凑合的吧
 
 
展开全文阅读
剩余:2000
上一页:一道物理提题