Linus Sequence
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
<img src=http://i.imgur.com/BfCoj.gif>
Define A as a sequence of 1 and 2 where:
A(1) = 1 and
A(n) minimizes the length of the longest possible doubled suffix of A(1..n).
For example, the next element of the sequence 1,2,1,1,2,2,1,2 would be a 1, which creates the longest doubled suffix of "(2,1),(2,1)", whereas putting a 2 instead would create a longer doubled suffix of "(1,2,2),(1,2,2)".
Output the first 1,000 elements of A.
- leonid
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
*NOTHING*
Sample output:
1211221211212211211122121122111211221211212211211122121122122211212211222122112122121122122211212211222122111211221211212211211122121122111211221211212211211122122211212211222122112122121122122211212211222122112122111211221211212211211122121122111211221211212211211122122211212211222122112122121122122211212211222122121122122211212211211122121122111211221211212211211122121122111211222122112122121122122211212211222122112122121122122211211122121122111211221211212211211122121122111211221211222122112122121122122211212211222122112122121122122211211122121122111211221211212211211122121122111211212211211122121122122211212211222122112122121122122211212211222122111211221211212211211122121122111211221211212211211122122211212211222122112122121122122211212211222122112122111211221211212211211122121122111211221211212211211122122211212211222122112122121122122211212211222122121122122211212211211122121122111211221211212211211122121122111211222122112122121122122211212211222122112122121122122211211122121122
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | yvl | 55 | 0.0799 | 2013/01/27 09:04:43 | 0B / 22B / 33B |
2 | clock | 55 | 0.0938 | 2013/01/27 13:04:12 | 0B / 23B / 31B |
3 | jpl | 57 | 0.0809 | 2013/01/24 00:04:51 | 0B / ?B / ?B |
4 | jbb | 57 | 0.0942 | 2013/01/25 21:50:37 | 0B / 16B / 41B |
5 | Histocrat | 71 | 2.2559 | 2013/01/19 00:15:27 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 41 | 0.1204 | 2013/01/20 09:02:10 | 0B / 15B / 26B |
2 | tails | 42 | 0.0610 | 2013/01/20 13:19:59 | 0B / 14B / 28B |
3 | brx | 42 | 0.0566 | 2013/02/01 06:53:54 | 0B / 15B / 27B |
4 | jbb | 43 | 0.0894 | 2013/01/26 05:08:29 | 0B / 14B / 29B |
5 | brx(^^) | 154 | 0.0001 | 2013/01/22 02:07:34 | 74B / 51B / 29B |
6 | tails | 38 | 0.0642 | 2022/02/22 11:05:52 | 0B / 15B / 23B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 83 | 0.6597 | 2013/01/23 07:29:15 | 0B / 41B / 33B |
2 | hallvabo | 83 | 2.8016 | 2013/01/24 01:28:40 | 0B / 38B / 40B |
3 | clock | 85 | 0.0926 | 2013/01/22 17:59:56 | 0B / 39B / 41B |
4 | rolf | 109 | 1.3450 | 2013/01/19 10:51:56 | 0B / 56B / 45B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 77 | 0.1958 | 2013/02/01 07:38:06 | 0B / 32B / 45B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 60 | 0.1676 | 2013/02/01 07:28:51 | 0B / 28B / 32B |
2 | teebee | 69 | 0.1545 | 2013/02/01 06:47:46 | 0B / 31B / 38B |
3 | Sait2000 | 150 | 0.4510 | 2013/01/29 14:07:37 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ush | 92 | 0.0186 | 2013/01/31 10:55:40 | 0B / 50B / 42B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 70 | 0.7483 | 2013/01/31 00:51:09 | 0B / 22B / 37B |
2 | clock | 75 | 2.7056 | 2013/01/27 16:30:10 | 0B / 24B / 44B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | g33k | 1015 | 0.0001 | 2013/01/30 10:24:25 | 1B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock | 47 | 0.4466 | 2013/01/31 18:35:44 | 3B / 20B / 21B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Perl | tails | 38 | 10000 |
2 | Vim | clock | 47 | 8085 |
3 | J | I., S. | 48 | 7916 |
4 | Ruby | yvl | 55 | 6909 |
5 | JavaScript | clock | 60 | 6333 |
6 | sed | tails | 70 | 5428 |
7 | PHP | clock | 77 | 4935 |
8 | Python | leonid | 83 | 4578 |
9 | C | ush | 92 | 4130 |
10 | Haskell | henkma | 97 | 3917 |
11 | Brainfuck | g33k | 1015 | 374 |
return to the top page