* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
---
|
||
id: 5900f3d71000cf542c50fee9
|
||
title: 问题106:特殊子集和:元测试
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
dashedName: problem-106-special-subset-sums-meta-testing
|
||
---
|
||
|
||
# --description--
|
||
|
||
设S(A)表示大小为n的集合A中的元素之和。如果对于任何两个非空的不相交子集B和C,我们将其称为特殊和集合,以下属性为真:S(B)≠S(C);也就是说,子集的总和不能相等。如果B包含的元素多于C,则S(B)> S(C)。对于这个问题,我们假设给定的集合包含n个严格增加的元素,并且它已经满足第二个规则。令人惊讶的是,在可以从n = 4的集合中获得的25个可能的子集对中,仅需要对这些对中的1个进行相等性测试(第一规则)。类似地,当n = 7时,仅需要测试966个子集对中的70个。对于n = 12,可以获得多少261625个子集对需要进行相等性测试?注意:此问题与问题103和问题105有关。
|
||
|
||
# --hints--
|
||
|
||
`euler106()`应返回21384。
|
||
|
||
```js
|
||
assert.strictEqual(euler106(), 21384);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function euler106() {
|
||
|
||
return true;
|
||
}
|
||
|
||
euler106();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|