Branching Computations
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Consider a language which consists of 5 commands. It operates on a list of integers, which is initially [0], a list containing only 0.
You will be given lines of input corresponding to separate trials, each starting with the list being [0].
Commands:
v : "branch". Replace each integer N in the list with [N-1, N+1], flattening the result
< : "trim left". Removes the leftmost element in the list.
> : "trim right". Removes the rightmost element.
^ : "sum". Replaces the list with a list containing the sum of the integers in the list.
/ : "product". Replaces the list with a list containing the product of all integers in the list.
Notes: the empty sum is 0 and the empty product is 1.
For example, the input "v" would generate [-1, 1], and the input "vv" would generate [-2, 0, 0, 2].
--conor_obrien
Options
exec is denied
rejudge feature is enabled
now post-mortem time, all source codes will be revealed
Sample input:_
v
vv
vvv
vv<
v/
vvv<<^
v>v>v>
>^
</
<
Sample output:
[-1, 1]
[-2, 0, 0, 2]
[-3, -1, -1, 1, -1, 1, 1, 3]
[0, 0, 2]
[-1]
[4]
[-3]
[0]
[1]
[]
Sample input:_
vvvvv/vv<v>^v
vvv/v<^
^v^
vv<>v<v>v>>>^
vvvvvvv
vvvvv>>>>>>>>>>>>>/vvv^
Sample output:
[7381125, 7381127]
[10]
[0]
[-1]
[-7, -5, -5, -3, -5, -3, -3, -1, -5, -3, -3, -1, -3, -1, -1, 1, -5, -3, -3, -1, -3, -1, -1, 1, -3, -1, -1, 1, -1, 1, 1, 3, -5, -3, -3, -1, -3, -1, -1, 1, -3, -1, -1, 1, -1, 1, 1, 3, -3, -1, -1, 1, -1, 1, 1, 3, -1, 1, 1, 3, 1, 3, 3, 5, -5, -3, -3, -1, -3, -1, -1, 1, -3, -1, -1, 1, -1, 1, 1, 3, -3, -1, -1, 1, -1, 1, 1, 3, -1, 1, 1, 3, 1, 3, 3, 5, -3, -1, -1, 1, -1, 1, 1, 3, -1, 1, 1, 3, 1, 3, 3, 5, -1, 1, 1, 3, 1, 3, 3, 5, 1, 3, 3, 5, 3, 5, 5, 7]
[29160]
Sample input:_
vv>vv>>>>v^v<vv>^v>v>v>vvv>/vvvv<<
v<v<v<v<v<vvv
v<v<v<v<vvv/vv^vv^v/^
v>v>v>v<v>vv<>vv<>>/vvv
Sample output:
[-827131647449, -827131647447, -827131647449, -827131647447, -827131647447, -827131647445, -827131647449, -827131647447, -827131647447, -827131647445, -827131647447, -827131647445, -827131647445, -827131647443]
[2, 4, 4, 6, 4, 6, 6, 8]
[142883999999]
[-138, -136, -136, -134, -136, -134, -134, -132]
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 105 | 0.1519 | 2018/05/29 01:26:38 | 0B / 48B / 56B |
2 | rotary-o | 108 | 0.1711 | 2018/05/21 00:21:03 | 0B / 49B / 56B |
3 | Histocrat | 108 | 0.1466 | 2018/05/26 06:30:55 | 0B / 49B / 54B |
4 | angel_p57 | 110 | 0.1655 | 2018/05/17 17:15:00 | 0B / ?B / ?B |
5 | letranger | 125 | 0.1685 | 2018/05/19 08:11:33 | 0B / 51B / 69B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 112 | 0.0352 | 2018/05/15 15:48:46 | 0B / 36B / 73B |
2 | %20 | 125 | 0.0334 | 2018/05/23 01:10:20 | 0B / 43B / 78B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 147 | 0.0744 | 2018/05/19 07:47:06 | 0B / 70B / 58B |
2 | hallvabo | 147 | 0.1215 | 2018/05/20 00:16:24 | 0B / 70B / 58B |
3 | lynn | 158 | 0.0728 | 2018/05/19 04:24:05 | 0B / 83B / 70B |
4 | dianne | 160 | 0.0724 | 2018/05/18 15:40:55 | 0B / 86B / 64B |
5 | Da | 160 | 0.0774 | 2018/05/20 10:45:08 | 0B / ?B / ?B |
6 | rolf | 181 | 0.0763 | 2018/05/29 03:44:16 | 0B / 87B / 80B |
7 | _ | 226 | 0.0742 | 2018/05/20 10:58:17 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 130 | 0.1208 | 2018/05/29 01:28:51 | 0B / 59B / 49B |
2 | mypetlion | 150 | 0.1252 | 2018/05/18 01:22:45 | 0B / 73B / 60B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 211 | 0.0316 | 2018/05/27 18:05:47 | 1B / 98B / 111B |
2 | tails | 220 | 0.0315 | 2018/05/25 15:20:26 | 0B / 106B / 109B |
3 | mitchs (llhuii) | 209 | 0.0316 | 2018/05/29 15:35:25 | 0B / 96B / 112B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 29 | 0.1980 | 2018/05/15 14:26:37 | 11B / 11B / 6B |
2 | whio | 29 | 0.2120 | 2018/05/16 01:26:59 | 11B / 10B / 7B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | gs2 | tails | 29 | 10000 |
2 | GolfScript | mitchs (tails) | 61 | 4754 |
3 | Burlesque | Hendrik | 65 | 4461 |
4 | Ruby2 | llhuii | 105 | 2761 |
5 | Ruby | rotary-o(llhuii,Histocrat) | 107 | 2710 |
6 | Perl | tails | 112 | 2589 |
7 | Python3 | llhuii | 130 | 2230 |
8 | Python | llhuii | 147 | 1972 |
9 | Scala | rotary-o | 156 | 1858 |
10 | C | mitchs (llhuii) | 209 | 1387 |
return to the top page