2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4861000cf542c50ff99
|
|
|
|
|
challengeType: 5
|
|
|
|
|
title: 'Problem 282: The Ackermann function'
|
|
|
|
|
videoUrl: ''
|
2020-02-18 01:40:55 +09:00
|
|
|
|
localeTitle: 问题282:阿克曼函数
|
2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
2020-02-18 01:40:55 +09:00
|
|
|
|
<section id="description">
|
|
|
|
|
对于非负整数m,n,Ackermann函数A(m,n)定义如下:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
例如A(1,0)= 2,A(2,2)= 7和A(3,4)= 125。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
找到A(n,n)并给出答案mod 148。
|
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
## Instructions
|
2020-02-18 01:40:55 +09:00
|
|
|
|
<section id="instructions">
|
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
tests:
|
2020-02-18 01:40:55 +09:00
|
|
|
|
- text: <code>euler282()</code>应该返回1098988351。
|
|
|
|
|
testString: assert.strictEqual(euler282(), 1098988351);
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler282() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler282();
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
|
|
|
|
</section>
|