We study the problem of cutting a length-$n$ string of positive real numbers into $k$ pieces so that every piece has sum at least $b$. The problem can also be phrased as transforming such a string into a new one by merging adjacent numbers. We discuss connections with other problems and present several algorithms in connection with the problem: an $O(n)$-time greedy algorithm, an $O(kn\log n)$-time dynamic programming algorithm, and an $O(n+ k \log n + 2^kk)$-time FPT algorithm for $n-k$ pieces.
翻译:我们研究了将长度为$n$的正实数数值字符串切割成$k$个片段的问题,要求每个片段的和至少为$b$。该问题也可表述为通过合并相邻数值将原字符串转换为新字符串。我们探讨了该问题与其他问题的关联,并提出了若干相关算法:一个$O(n)$时间复杂度的贪心算法、一个$O(kn\log n)$时间复杂度的动态规划算法,以及针对$n-k$个片段的$O(n+ k \log n + 2^kk)$时间复杂度的FPT算法。