freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-327-rooms-of-doom.c...

56 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4b31000cf542c50ffc6
challengeType: 5
title: 'Problem 327: Rooms of Doom'
videoUrl: ''
localeTitle: 问题327末日的房间
---
## Description
<section id="description">一系列三个房间通过自动门相互连接。 <p>每扇门都由安全卡操作。进入房间后,门会自动关闭,安全卡不能再次使用。一台机器在开始时将分配无限数量的卡,但每个房间(包括起始室)都包含扫描仪,如果他们检测到您持有三张以上的安全卡,或者如果他们在地板上检测到无人看管的安全卡,那么所有的门都将永久锁定。但是,每个房间都有一个盒子,您可以安全地存放任意数量的安全卡,以便在以后使用。 </p><p>如果您只是尝试一次一个地穿过房间那么当您进入房间3时您将使用所有三张卡片并将永远被困在那个房间 </p><p>但是如果您使用存储箱则可以进行逃生。例如您可以使用第一张卡进入房间1将一张卡放入存储箱然后使用第三张卡退回到房间。然后在从点胶机收集另外三张牌之后您可以使用一张进入1号房间并收集刚刚放入盒子中的卡片。你现在又有三张牌可以通过剩余的三扇门。此方法允许您使用总共六张安全卡通过所有三个房间。 </p><p>可以使用总共123张安全卡通过六个房间最多可携带3张卡。 </p><p>设C是任何时候可以携带的最大卡数。设R是要经过的房间数量。设MCR是分配机器在任何时间通过最多携带C卡的R室所需的最小卡数。 </p><p>例如M3,6= 123并且M4,6= 23.并且对于3≤C≤4ΣMC6= 146。 </p><p>对于3≤C≤10给出ΣMC10= 10382。 </p><p>找3ΣC≤40的ΣMC30</p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler327()</code>应返回34315549139516。
testString: 'assert.strictEqual(euler327(), 34315549139516, "<code>euler327()</code> should return 34315549139516.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler327() {
// Good luck!
return true;
}
euler327();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>