algorithm - 找到完全改变累积和集的排列

标签 algorithm math permutation computer-science cumulative-sum

我遇到了以下问题:

Let N be a set of natural numbers with length n.

Let S be the set of all cumulative sums, where a cumulative sum is the sum of the first k elements of a set.

Now, given N, permutate its elements, so that S_i contains no element of S (i refers to the ith permutation).

Find as many of these permutations, as possible.

谁能帮我出出主意?您不必提供算法,只需提供方法。

最佳答案

显然,S_i(或S)中的最后一个元素是所有元素的总和。无论您如何排列元素,该元素始终位于列表中(顺便说一句,如果您引用一个顺序,调用 NS 集合在语法上是错误的)。

因此,N 不存在 S_iS 不相交的排列。

关于algorithm - 找到完全改变累积和集的排列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48560919/

相关文章:

algorithm - 计算图中三角形数量的有效算法是什么?

java - 如何随机生成一个函数,该函数是 <10000 的整数的排列

GWT 排列计数

python - 圆素数计划欧拉#35

Java,与数组的组合算法

c# - 如何检查数组中的所有概率

algorithm - 关于任务并行化的问题

r 如何使用这些约束重新调整一系列数字?

Java/Android 数学测试 : Got Curious About Int and Float Math/Conversion/Casting

java - 无法找到为 Mandelbrot 着色的方法 - 设置我的目标方式