freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-359-hilberts-new-ho...

56 lines
2.0 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: 5900f4d31000cf542c50ffe6
challengeType: 5
title: 'Problem 359: Hilbert"s New Hotel'
videoUrl: ''
localeTitle: 问题359希尔伯特的新酒店
---
## Description
<section id="description">无数人编号1,2,3等排成一列在希尔伯特最新的无限酒店找到一个房间。酒店包含无限数量的楼层编号为1,2,3等每层楼包含无限数量的房间编号为1,2,3等<p>最初酒店是空的。希尔伯特宣布了关于如何为第n人分配房间的规则人员在最低编号的楼层中获得满足以下任一项的第一个空置房间楼层是空的楼层不是空的以及最新的人是否占用房间在那个楼层是人m那么m + n是一个完美的正方形</p><p>由于1楼空了1号人员在1楼获得1号房间。由于1 + 2 = 3不是完美的正方形因此人2在1楼没有得到2号房间。由于2楼是空的因此人2在2楼获得1号房间。人3在1楼获得2号房因为1 + 3 = 4是一个完美的广场。 </p><p>最终,该线路中的每个人都在酒店获得一个房间。 </p><p>如果人n占据楼层f中的房间r则将Pfr定义为n如果没有人占用房间则定义为0。以下是一些例子P1,1= 1 P1,2= 3 P2,1= 2 P10,20= 440 P25,75= 4863 P99 100= 19454 </p><p>找到所有正f和r的所有Pfr之和使得f×r = 71328803586048并将最后8位数作为答案。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler359()</code>应该返回40632119。
testString: 'assert.strictEqual(euler359(), 40632119, "<code>euler359()</code> should return 40632119.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler359() {
// Good luck!
return true;
}
euler359();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>