56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
|
---
|
||
|
id: 5900f5181000cf542c51002a
|
||
|
challengeType: 5
|
||
|
title: 'Problem 427: n-sequences'
|
||
|
videoUrl: ''
|
||
|
localeTitle: 'Problema 427: sequências-n'
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id="description"> Uma seqüência de inteiros S = {si} é chamada de n-sequência se ela possui n elementos e cada elemento si satisfaz 1 ≤ si ≤ n. Assim, existem n sequências n distintas no total. Por exemplo, a seqüência S = {1, 5, 5, 10, 7, 7, 7, 2, 3, 7} é uma seqüência de 10. <p> Para qualquer sequência S, seja L (S) o comprimento da maior subsequência contígua de S com o mesmo valor. Por exemplo, para a sequência dada S acima, L (S) = 3, por causa dos três 7s consecutivos. </p><p> Seja f (n) = ∑ L (S) para todas as seqüências n S. </p><p> Por exemplo, f (3) = 45, f (7) = 1403689 e f (11) = 481496895121. </p><p> Encontre f (7 500 000) mod 1 000 000 009. </p></section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id="instructions">
|
||
|
</section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: <code>euler427()</code> deve retornar 97138867.
|
||
|
testString: 'assert.strictEqual(euler427(), 97138867, "<code>euler427()</code> should return 97138867.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function euler427() {
|
||
|
// Good luck!
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
euler427();
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|