Problem Statement
Invader Squid Girl is a big fan of the Advanced Turing Game. This is a game in which the player programs a simple Turing machine (defined below). The goal of this game is to turn the starting tape into a pre-determined goal tape.
The picture above explains how the Turing machines in our problem operate. On the top you can see the goal tape: a finite sequence of cells, each containing a zero (0) or a one (1). The player starts with a tape of the same length as the goal tape. The player's tape is initially filled with some zeros and ones. The Turing machine has a "head": a reading and writing device. At each moment, the head points at one of the cells of the tape. In order to change it to the goal tape, the player picks a starting cell for the head and writes a program for the Turing machine.
In this problem, the program is simply a sequence of commands, executed one after another. There are just four commands:
- '0' : Write 0 into the cell where the head points. (The old content of the cell is lost.)
- '1' : Write 1 into the cell where the head points. (The old content of the cell is lost.)
- '<' : Move the head one cell to the left.
- '>' : Move the head one cell to the right.
It is not allowed for the head to leave the tape (i.e., move left from the leftmost cell or right from the rightmost one). Should that happen, the player loses -- even if the goal has been reached before the head left the tape. In other words, a level of the Advanced Turing Game is considered solved if the head never leaves the tape, and at any point during the execution of the program (including the beginning and the end) the content of the tape exactly matches the goal tape.
Squid Girl recently solved a level of the Advanced Turing Game. However, she forgot the initial contents of the tape, and her choice of the starting cell. All she remembers is the program she wrote, and the content of the goal tape. Help her by counting the number of possible initial contents of the tape.
You are given a
Definition
- Class:
- MapGuessing
- Method:
- countPatterns
- Parameters:
- String, String[]
- Returns:
- long
- Method signature:
- long countPatterns(String goal, String[] code)
- (be sure your method is public)
Notes
- Note that we are only counting the possible initial contents of the tape. Even if multiple starting positions work for a given tape, we only count it once.
- For some test cases the return value may be zero (0).
- The constraints imply that code will contain at most 555 characters.
- The automaton used in the problem is not an actual Turing machine. The actual Turing machines are more complex, with a potentially infinite tape and a more powerful "programming language". Of course, this has no relevance regarding the problem you have to solve.
Constraints
- goal will contain between 1 and 36 characters, inclusive.
- Each character in goal will be either '0' or '1'.
- code will contain between 1 and 15 elements, inclusive.
- Each element of code will contain between 1 and 37 characters, inclusive.
- Each character in each element of code will be one of '0', '1', '<', and '>'.
Examples
"000"
{"0"}
Returns: 4
There are 4 possible contents of the initial tape: "000", "001", "010", and "100".
"001"
{"0>1"}
Returns: 5
There are 5 possible contents of the initial tape: "000", "001", "010", "011", and "101". Note that for the initial tape "101" we have to choose the leftmost cell as the starting one. We will then reach the goal after the first command is executed.
"000"
{"1>1>1"}
Returns: 1
The goal can also be reached before any commands are executed.
"11001"
{">><<<<><<"}
Returns: 0
There is no possible contents of the initial tape. (We do reach the goal if the initial tape is equal to the goal tape, but as the head leaves the word, this does not count.)
"1000101011"
{"1<<0>>0>1"}
Returns: 22
"00000010000000000000000000000000"
{"><>>0<0<>>1>0><>", "<<0>>0<>><0>0>>><><", ">>>0<>", ">0><>>>>0<<><>>0>>>0<0>>0>"}
Returns: 13601
Don't forget to concatenate code.
"11100011010111111010100100110001101"
{"11111111111111111111" ,"1<><><><><><><><><>1" ,"1<>000>000><0<><0<>1" ,"1<0<><>0><0<00>00<>1" ,"1<>00<>000><0<0<0<>1" ,"1<><>0>0><0<0<><0<>1" ,"1<000<>0><0<0<><0<>1" ,"1<><><><><><><><><>1" ,"1<>000><000<>000><>1" ,"1<>0><><0<><>0><><>1" ,"1<>000><000<>000><>1" ,"1<><>0><><0<><>0><>1" ,"1<>000><000<>000><>1" ,"1<><><><><><><><><>1" ,"11111111111111111111"}
Returns: 90
"000000000000000000000000000000000000"
{"0"}
Returns: 37
"000000000000000000000000000000000000"
{">>"}
Returns: 1
"000000000000000000000000000000000000"
{"0>0>0>0"}
Returns: 272
"000000000000000000000000000000000000"
{">0>>>0"}
Returns: 68
"000000000000000000000000000000000000"
{"<<<<<>>>>>"}
Returns: 1
"000000000000000000000000000000000000"
{"<<<0>0>0>0>0>0>0"}
Returns: 1984
"000000000000000000000000000000000000"
{"<<<<<<<>>>>0>>>"}
Returns: 30
"000000000000000000000000000000000000"
{">>>>0>>0>>"}
Returns: 59
"000000000000000000000000000000000000"
{"<<<0>>0>>0>>0>>>0"}
Returns: 639
"000000000000000000000000000000000000"
{"<<<<0>>0>0>0>>0>>0>>"}
Returns: 1205
"000000000000000000000000000000000000"
{"<<<0>0>>0>0>>>>>>>"}
Returns: 259
"000000000000000000000000000000000000"
{"<<<<<<<<<<0>>>>0>>0>>0>>0>>"}
Returns: 511
"000000000000000000000000000000000000"
{"<<<<>0>0>>>>>>>0>0>>0>0"}
Returns: 1224
"000000000000000000000000000000000000"
{"<<0>0>>0>>0>0>0>>>0>0>>>0"}
Returns: 10062
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<>>>0>>0>>>0>>>>>>>0"}
Returns: 265
"000000000000000000000000000000000000"
{"<>0>0>0>0>0>0>0>0>>0>0>0>0>>0>"}
Returns: 126168
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<0>0>>>>>>>>>0>>0>0>>", ">>"}
Returns: 502
"000000000000000000000000000000000000"
{"<<<<<<<<<<<>>>>>0>>>>>>0>>>0>>>>"}
Returns: 100
"000000000000000000000000000000000000"
{"0>>0>>0>0>0>>>0>0>>>0>>0>0>0>>"}
Returns: 32858
"000000000000000000000000000000000000"
{"<<<<0>0>>0>>0>>0>>0>>0>>0>0>>0>0>>0>0"}
Returns: 124895
"000000000000000000000000000000000000"
{"<<<<<<<<>0>>0>0>0>>0>>>0>>0>0>0>0>0>>", "0>>>0"}
Returns: 115670
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<>>>0>>>0>>>>0>0>>", ">>>>0>>>>0>"}
Returns: 811
"000000000000000000000000000000000000"
{"<<<<<<<<<<>0>0>0>0>0>0>0>0>>0>>0>0>>0", ">0>0>0>0>0>0>0>0"}
Returns: 11978407
"000000000000000000000000000000000000"
{">>>>>>>>>>>>>>>>>>>>>>>>"}
Returns: 1
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<<<<>0>0>>>>>>>>>0", ">0>>0>>>0>>>>>>>0>0"}
Returns: 2701
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<>>0>0>>0>>>>>0>0>0>", "0>0>>>0>>>0>0>0>>>0>"}
Returns: 79868
"000000000000000000000000000000000000"
{"<<<<<<<<<<<>0>>0>0>>>0>0>>0>0>0>0>0>0", ">>0>0>0>0>0>0>>0>>0>"}
Returns: 4537225
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<>>>>>>>>0>>>>>>0>0>0>0>>>", ">0>>>>>>0>0"}
Returns: 1917
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<0>>>>>>>0>>>0>0>0>>0>>", ">0>0>>0>>>>0>>>>>"}
Returns: 6998
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<0>0>>>0>>>0>>>0>>0>>>", "0>>0>>0>>>0>0>>0>>>>>0"}
Returns: 48853
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>0>>>>", ">>0>>>>>>0>>>>>>0>>>>0>0>>>>>"}
Returns: 311
"000000000000000000000000000000000000"
{"<<<<<<<<<<<0>>0>>>>>0>0>>0>0>0>>0>>>>", "0>0>0>0>>>>0>>0>0>>0>>"}
Returns: 261222
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>>"}
Returns: 1
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>", ">>>>>>>>>>>>>>>>>>>>>>>>>"}
Returns: 1
"000000000000000000000000000000000000"
{"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>0>0>", "0>>>0>0>0>0>>>>0>0>0>0>0>0>0>0>0>>0>0", ">0>0>0>>>0>>0>>0>0"}
Returns: 33554432
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 68719476736
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 196608
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 376832
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 720896
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 1376256
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 2621440
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0"}
Returns: 4980736
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0"}
Returns: 9437184
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0>0"}
Returns: 17825792
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0>0>0"}
Returns: 33554432
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0>0>0>0"}
Returns: 62914560
"000000000000000000000000000000000000"
{"0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0>0", ">0>0>0>0>0"}
Returns: 117440512
"000000000000000000000000000000000000"
{"0"}
Returns: 37
"111011111111111111111111011101010111"
{"<<<11111<1<1>11001>11>111<>1><<111111", "1>111111111111111<<11101>1101<<<1111<", "11<110<111<1110<11<<1111<<>111<><>111", "1<111>11<1>><><1>1>1111111001>111<11>", "110<>1><>11<<>1<1<11111111<011<1111<1", "11<1<1<1001<1>1<11<11>>011<01111>110<", "1<1<1>1>>1>1><11<11101>1<1111><1><111", "<<>11>111>><1>1><11<111111<<<0<1101<<", "111<01<1<<111101><1<<11<1111>11>1>11<", "0<<1<11>1111>1<01>0>1111>1<1>011111>1", "111<1<>1<><1>0<110><>1111>0<0>>><1111", "01>1<1><1110<1>1<<1111111<111>111>1<1", "111>0111110<11>0>1111<>><10<1<>0<11<>", "<<1<01>1<>11>0<10<1>1011>>11<11111<1<", "1>1<1>111111101<>><111<>1111<1<1><01<"}
Returns: 8
"111111111111111111111111111111111111"
{">1<>>1<11<><1>111>>><1<><1>1111<<<>><", "<<><11<>11<<111><>><<1>1<1111>11>><><", "11>1><1>111>1<1><1><11<1>1><>11><>1>>", "11><1>1>1>111><1><>11>1>1>1><1<<<1>1<", "<1111<<11>1<111111>11>1<1111111111>11", "1>1<>111<<><>11<<1<11>>1<>1>>>>1<<<1>", "<1>1>>111<1>1><1111111>1>>>11<1<>1111", "1<111<111<>1<11>>11<>1<1>11>111<><1>>", "1<11>1>11<<11>>>1<11><1<<><<><1<><>1>", ">1><>>1><>1<<11>111>1111><1>><<>11<<1", "<<111>1<11<1111>1>>>>1<>1>1111>1><<1>", "<<>>><1111<<<1><1>111<1<1111>111><1><", "<<><11><11>>><11><<1<>111><11111>1111", ">>1><<><>1<1>1>1<1<<>11111>>1<><1<11<", "<<1>111>11><<<1><>111>111<<1<1<1<<>11"}
Returns: 130488832
"011110101010101011101111111111001011"
{"0>00<11100010101<1<0001>100010011100<", "10101<10<1001<000><11<001111000101<<0", "1101001<1<1101>111<0000<01011011>1<00", ">>000>>00>101100<1<>00000>000<0<0101<", ">1111>1>100>001100001<011011<<<<<0000", "001<010<1001110>1100<01000101><011010", "01<1<1000>0000110><1011010<0010<0<000", "<1101>1110101011011>00101>00101001110", ">10111<000<000011<00010>100>011><01>1", "1011110>00<111110>1<00011><1111010111", "<00001>1000<011<10011100000>00<100010", "00101<0<001>010110>01001100>101111001", "101000111><0>>01>11<0<1001011<1<11000", "111<1<0010>1000<00111101010><1<01010<", "1110>0111<00101<0111111111010<<001000"}
Returns: 30
"111111111111111111111111111111111111"
{"1<><><<<>>>>1<>>1>11>>>1<11>1>><<>1>>", "1>>>1<><1<1>11<1>1111<111<>>><<1<<11<", "111<11>11>11>><<>1<>1<11>1<11<<><111>", "><>>>11<<>11<<11>11<<><1<>><<<<>1<1<1", "1><11<1<<<<<<11<>>>1><1<<1>>111>1><<<", "<<11<1>1>>>1>>>><<><11>1>1<><1<11<>11", ">111>1<1>><<><<>1111<11>1>11<1<<>>11>", "1><>1<1<<<1>><<>><1<>>1<>1<1><1>11>11", ">>>1111<1<<1<>1><<>1<<><1><><>>1><>><", "1>>><><<>><11111<1<>1111>><<1><<1<>>>", "1<<<111>1<<><<1>><1<>111111>1>11111>1", "<1<<<111<11<<1><1<<1<<<>11><>>11>11<<", "11<11<111>1><11<<<><<1>>>><>1<><1>11<", "<>>><<>11<1111><11>1<>1<<<<1>1<>>1>>>", "111>>><<1111<1>1111<11111<>11>1<111<1"}
Returns: 218103808
"111111111111111111111111111111111111"
{"111><11>11>11>>11111<11111<1>1>>1<11>", "11<>111111>111111>111<11111<>>1111><1", ">1<1<1<>>1<>111<>1111<111111>1111<11>", "11111<11111>1<<111>1><1<111>1>><111>>", "1>111111<1><1111111<111<<1>11111>1<11", "<11<1>11<<1>11111>11<11<11>>1<1111<11", "1<>111<>>111111<111<11<><<11111>11111", "111<11<>1<11<>><1<<11111111<11><1<111", "11111>11<11<11>11111111111>>11><1>1<1", "<>11<>11<1<1<11<1<1<11><11111<111<111", "1>1111<>1111111>11>>><11>1<11111><>1<", "><1>111>111><><111<<<<1111>11>111>111", "1111<11111111>1<11><1111111>11<<>1<11", "1<11111>1>><<111111>11111<11>11<1<>11", "1<<111111<>1111>1111>1<1>111111>1<111"}
Returns: 17825792
"100110001011000010000101110111111001"
{"0000000110011010001>11>01111010001100", "11111000<100100111>1100<010101111>010", "0<001001010111011>1000111001011111001", "1101001111101011010101111110110>01000", "0111001111111100010110<10111111011111", "1011100001111011111001010110011111100", "10001101>1011111100110111100><1010010", "1000010110100001010001010110001100010", "0110111110001111000100<10011000111101", "10111110100001101011<110001110111100<", "101001010010000101010110111101>11001<", "0>11111>1001111011001100<010010110011", "1<101011111<100<111011111111>00010010", "100001111100000011110011000010100010>", "11101010>1011001<01001100011101100111"}
Returns: 295
"000100000100010100000000000000000000"
{"1<<01>0<0000><0100>000<0<00000>001001", "01>0100000>1>100001><100>11>100001100", ">>100001000>0100>001>>01>0100><>0<00<", "000<01<1<01011>>>00>0>00<0<><1111<00<", "<>>0110><110<000001010001010<11<0>010", "1<000100<<0000000<00>111<>010000>1010", "0001<00>0<00>0000>0>0<1100101>110>>1>", "001<11>>0<10<0100<01<1><01000011000>0", "0>00<>00001>01<0<00<100><1>1<0>00<<01", "000<0>0010><00001<101<011<1<100001100", ">01><01><010100>010>><1<0>><01>0>1>01", "000100>000<10<0010>>11010<100>101<01<", "01<1>0>0<00010000>0>00000000<1<1><<1<", ">>00100010>0<>>0>0<00>011<01<01>1101>", "01000011011101<<<0<00<11<<1>001>>001<"}
Returns: 74
"010000110000010000000110000000011000"
{"<0<1>0<0>0000000000000100000><1<11<01", ">00001000010<00000>011010<00<<00010>1", "1000>0011000100>00000>0110<01010>0000", "<0010001100000000>00100>11000<1001000", "100>1110>01<1<<011010000011>0001000<0", "001010><00000000<0000100<0><10>000001", "000<0000110<0<1<000101001111000>100<0", "0<<0<101000<<01<0<<000>0001010000001<", "0<00001><10000000001100>0000000000010", "100100<000000000100><>0011<00><101001", ">0<0<000>000101001010010100110001010>", "0><00>00111000001<00100000<0000<0<000", "000>01>00>000<00<01100100100010010010", "<<00001<0<>0100<010>0><1011>00<000000", "<01000000<10<1<001001000001<000100101"}
Returns: 578
"100011000111010110010110101000000101"
{"11<>01><0<<0<>01<<1<<<01>0>101>01>1>1", ">1<>>>11>10>><<>00011<1>01><>>001><<1", ">01<<1<10>1>101>0<10><10><><1<><>0><<", "1<11>><<<>0<11><<1<<>1<1<<11<0><0<1<<", "<0000101<<01<110>>01>>1<00<><<01<>0><", "><>1>1>>010><01>>01>11><>>><<<<>>0011", "010>>10><<>>010>1><110>00<11<<<1>><1>", "1>01<<><<<1>>01><>>>>>1>1><0<0>0<10><", "<<<1<>10<<<<>1000<><0><>0><1<>0>0>01>", "><<1<<0>111<<1<0<10>00<<>1<000><>000>", ">>1<><1<>>>0><>011>0<><><1<10010>>>>>", "0110>111>0<><0>11<1<<0<>0<00<>10>>11<", ">0<>00>111>1<1<<<0011<11><101<><>>>00", ">11>1<>11<<1<011<<1<1<<><>0<>>>100<1>", "0><0<00100010>0>>>11<10<<<000>>01>>>>"}
Returns: 161
"111111111101011111111111101101111111"
{"111<>>1><1><<<1<<<0<<<>10<>11<1><0111", "<>1>>>>011><>1>11<10>111<111<<>><11>>", "<>1<<>11<<<1>111>>>1<<11>1<<1>1<<>011", "<111<<<1>11><<1>10>111111><1<<0<>>0><", "<>><1>>><110011111<1>>1><><1<<1<1<<><", "0<<0><1<1<>11>0>111>>>>0110>>1<<1111<", ">>1<<>11><111<0>>11110><1>1<11>11>1>0", "0>1111><1110>><>0<>0<<><11<>11<>>>11<", "01111<<1>1<1>0<1><<>1>01<1<0<<<1<<<<>", "><<0>010<<1>0>1>11>><>>001<100<<1<<>1", "><<111><1><><<11<>1><11<>1<11<1>111<1", "1<<01<0><11>111<>>><1>1>>><0<10>>1>1<", "><1000<<<0<>>1<<1>1>111><111101>1>><>", ">0<<<>11><1<>1>101110><111<<><>><<<>1", ">11>><<<<<><1<><<0<11<11><1<<1><1<1<1"}
Returns: 3071
"101011011000010000101110001100001001"
{"1000>>11010<>1011010<<001><000<0000<1", "00000><00>1><10100110<1<1>00<0>1011<<", ">00010100<1>1100><00<000<00>>011010<<", "0>0000001<0001001010<001>0000>><>1>0>", "10001<<>0>10<1<1>>1>1><00<01>0<1>1<10", "00>000100<>1<01<1<0000<100100>01<0110", "10>11<>000100100001111001<010<01>0>10", "<0000<110001>000>01<1>0010<0011110<01", "1010<<111000001111010111100000<01000>", "1<000><0011101><0<01>>110101>1<1001>0", "<<1<100>>11>0<<00><100<110>0<0<100011", ">011000>10<11<<<00<><100<1>0001<<1001", "<1<100<11001>101001110000<010>0001100", "00>0000<><1001<000>10<1<<<01<100010<1", "11101<11001>1000>00>100<10000000>0111"}
Returns: 158
"101001000010001000010010010100001010"
{"0<0000100000100000001000<11>000000010", "01011>1010>10000100011000><10000>1010", "0<100010001001011110110001<0100<00000", ">0011010101010100>1101>10000011001110", "0>>1000<10010010001100011001>>0<00100", "000100010111>011010010001101010001011", ">0100001001000101<0000>01000111010000", "0000101010001011><0000011>110010011>0", "<010001000000>00000010<00110000001010", "0100110010010001000000111>1<0>00<0111", "000010111011>10101000<00000>10001<110", "000010>000>00>1100>>00000><00001<0000", "0001>1<00001001000100>0>11010>1000000", "010>0001>>101001<>110<00000000100110>", "0100000>001000001>>0>00<10100001>0000"}
Returns: 153
"100000001011101100001011001001110101"
{"<011<110>0>11111001<>11100>0><00010>0", "1110110111011<101>>1<0010>110<0001001", "10<011111011010<1><110101100111101110", "1110><0110>101011<10000101<111>10>110", "1<1110110111000111>0011001<1<100<111<", "1>11010<<100010<101<0000>11<10001>111", "1>011>>011><011111011<1000011<10>0010", "11000110111011<<011>111101>00>111>011", "1>0001110001111111001010100<<1001110<", ">00<0110111100010>11>0>0010110<01<>01", "110<0>0><<0>11110<<00011111011111<0<1", "01110000110<0>1010100>>0101>>111>>>>1", ">1101>01<001010011110<>1001<001>010>1", "<010><011000010100>1101111100110>1001", "1101100>10100<01111111<1>001101110011"}
Returns: 373
"010001000000000000000010000000100000"
{"00000000<0>000000>01>0000000<00000100", "<00<0<<000>000>000010101>00<0100<0010", "01000>>10001001<0>000<<000>0000000000", "00000000<0000>0000<000>01000<10000>00", "1001000<00101001>>00000010<0<00000000", "1001<10<0000<0000001<>01010000<>00>00", "<0<000<>00<001>0001000000>1010000<010", "<00000>00000000<0000<000<0100<10<0001", "00000<0000001>>0<0>10>00<1001<0001000", "000010001><0000>00>0<0>0000<0000<0000", ">00110<00>>00000001000<000000>001000>", "0001001000<<000000>000000001101>>0001", "0001001000<1>1000>0000>0000000000000<", "<0>0010000>0000000000100000000>00<000", "0000<00100<000001110000>0000001<1000>"}
Returns: 41032
"101001010110111110110111111110011111"
{"1111101<10111000111111101011111111011", "<11111011111110100110000111110<010111", "01110101111100001111011010101<0011111", "101011000011<10111101100110<110111111", "0111111<111<0111011000011100101111110", "<10101011111100101010111111110<11011<", "11001111111111101<0101110110101111100", "1111101110011110111111010101100111011", "100011>111<01111011000<1100<11010<101", "11111010111110010110001111<1<01110111", "1111001101001111111101110111011111101", "1111101010110101111110101111101010111", "101111<11<101111<11011001111011011111", "1011<11111110011111110101111001111<10", "1010<01111111011100111000101111011<10"}
Returns: 51
"111101011111111111011111111111111011"
{">>>1>><>><1<><<<1<1><<>1<<1>1<<>><<<<", "<<<<><1<<>1<><<<0>>><00<<><><<<<>1>>0", ">0><<<0<0<>1<>>0<>>><><<<<>1<<><1><>>", ">><>1<<<>>0>><<><<1<<<>10><>>1<><<<0<", "<>11>><>><><><<<<>1>><>>><<>1<<>0>1>>", ">11>0<<1<><><1<<>1>><><><>1><<>11<<>>", "<<1><1<0<<1>>11><>><1<1>>><><><<>>><>", "<1<><<1<><>><<<<1<>><><<0><0>>>>><><<", "<><1><1><><>><1><>11>>1>>><<<>>0<>1<<", "<><<<1<>><<<<>>>>>>01>1<><1>1>>>1>1><", "<>>><>>><0>>1<><1><<<1<>1><<<<<<<<><<", "<<<>>><<<<0>>><>><<<<<>>><><1<1>>1<>1", "<><>>0><<<<>><<>>>1>><><<>111<<><<<0<", "<>><<<<>>>01<<<<1><1<><>>0<<>0>0>>><>", "<<1>1<<<<1<>1<<<>>0>>><<1>>1<0<><<<><"}
Returns: 368
"100111011110110110011111001001111010"
{"111><1111011111000010111111<10<0<10<1", "1100101111111>101111011<1011010111011", "1110111<1111>10>01111111<111101010010", ">00100<011101<01111101111111111101101", "11011<001<01110110>10101111111100010>", "0111>1>011<01010010010011110011111111", "1111011111>11101<110111>00100<1111010", "00001101>110>0111011010111111>011<011", "10110111110100101>11111101>1111101010", "111<0011110111<0011011010110100110110", "0011010010110111110100111011011010011", "1101011011110011110101111<100111>1100", "1<101111000111111100>11101>101111110<", "001>11111>11>101111010111101110011110", "0010111>11110110<<>1011011111010010>1"}
Returns: 399
"111111111111111111011111111110111111"
{"><><>>><>><><><<><<><><>1<><>><<>>><<", "<1><<>>>><<>>><<<<>><<><<<<<<>>1<<><>", ">>>><<<>>>><<><>><><>>><><<<<<<><<>>>", "<>><<>><>>><><><><<<><>><<><>>><><><<", "<>>>>><>0<><<<>>><<>>><>1<<<<>>><<<>>", "><>>1><<>>><>1<>><<>>><<><>><<><><<<<", "><<<>>>>>>><><<<<>><>>><>>>>>><<><>>1", "><><><<<>><>>>><><>>1<><<1<<>><<>><<>", ">><<>1<<><<>>><><>><>>>>><>>>><>1<<<<", "<<<><<><<>>><<<>>>><<>>1><<>>>>><><<>", "><<<<><><><<><<<>><>>><>>>><<><><><>>", "<<<1<><>><<<<>>><>1<><<><<<<><>><><<>", ">><><><1<<>><><<<<<<<>><1<>>>><>>>><>", "<<>>>>><>><<<<<<>><<<>><>><><<>>><<<<", "<<<<><<<1<>><>><><><><><0<<><<<<<<>>>"}
Returns: 40
"111111011110111111111111101111101111"
{"1111<111111111111<111101110111<111110", "1101110011111011111001001111111001111", "1111011111111110111111111101111111111", "1111111101111100<11111010110111111111", "111100001011110111111111011011011>111", "<0111011111111011101111111<1111111110", "01111101111110111011010<0100111111101", "111111111111111111<111111011111111111", "100111110111110111101100<<00111011111", "1111111011100111101011111101100111111", "1111101111111101111111101011111111011", "10011111010111<0111111111101111100111", "1110101111110111111011111111101111<10", "<101111100111111001011101001111<1<111", "0101101111111111010111111>01011010111"}
Returns: 810
"111111111001101101111111101110111111"
{"11111011111011110<1111111011111111111", "1110101111111011110111111110111111110", "11>1110111011110111111011111<11111<11", "1111111111111111011111<10<1111101111<", "11101111010101110111001111<1111110111", "1111101111111111111101111111011111111", "10111111<101010001111<00101111111<<10", "1111111111111111110101100110100111111", "1111110101111011101111<11101111101011", "0111011<11111110<11110111110101111110", "11111111100001<11<1001111111110111111", "111111111110111110111<111111101111111", "11110110<110110111001110111001111<111", "1111110100111101111111011111110111111", "1111100111111111101011011111101110<11"}
Returns: 33108
"011001011111100000111111011111111111"
{"11>1>0<>>1<1<0><110<0<11<<>01>>0<0>0<", "01>0111<101001<00>1<>0<0001<10<11<0<<", "0101>0<1<>11111011><<<01111><1>>11>10", "<1011<11><<111>1<<01<<<<11<1<<>><<<10", "111>110>1<>01011>110<111111>111011111", "10>><111111111<101><>01111011>1<<1111", "1101101<111>0<<>1<>>>>11<11<0001<1111", "11>11110100101>111<<1<11111<0>><<1101", "01>1<1>00<1<111>11<1000>11<11>1110>1>", "110101<>1<<111>1><1>111><<1<00011011>", "001<11101>11<011>100<01>100111110<<>>", "1<1>><>1<11111>1<>00<<>1<<>0<11>1101<", "110><>1101<0000<<1<1>11011111>1011111", "11>11001111<1111>1<111111<>10>>010111", "01<1<1>1<1>111>000<1>100>011<>110>>>0"}
Returns: 132
"000000001000000000000100010000000010"
{"0000000000000100000000010010000000010", "1000>00000001000000110001010000000010", "0000001000000100000000000000000000000", "0000101000000000000000000010000000000", "00000000000100>0000010000000000010000", "0100000000010010000000000010000000000", "000>000000000000000100010000000000000", "0000000000000000000000000010000100000", "01000000000000000>0000010000000000010", "0010000010010000000000000000000001110", "0000000000000000000000>00000001000000", "0000000000001000000100000000000000000", "0000000100000000000000000000100000100", "0000001000000000>00000000000000000000", "0000>000000>0011100000000000010100000"}
Returns: 2573
"101011110010100001101110010100110100"
{"1100010111100001100000011101111110000", "0111011010011100001111101010111101110", "0101010011101100111111011010011111010", "0011100111110100010001111010111101011", "01010100101100000100>1101100010110111", "1001001010110010010000111001000011110", "0001100000101101001011011110101001011", "0010111110110010110100000100011010010", "100001000<110100011100011011110111101", "0000110111110111111100100110010101111", "0111111000111010010000010110111111111", "1101001000011010110000100010110000100", "0100101100111010110001011100011100001", "1110000000101000111110110100111000110", "1101110111100010010100100001110011101"}
Returns: 65
"000000000000000000000000000000000000"
{"<<000000000>00<<<00<<00<0>0000000<>00", "0000000<0<00>0><0>0000<<>0000<000000<", "0<<0<<>0<000><<000<<00>>00<>0<<000<<0", ">0>0>00>0000000000>0><000<>00<00>00><", ">00<000000000<000<<0001><<00><>0<><<<", "000<<00>><00000000>0000><00<0<00>00<<", "0>>0>0>>0<000000>>0>000<0>>000<00>0<0", "000>0<00>00>>0>>00<<000<00000000<0>0<", ">00000><0>>00<0000<><<0<>000000<00>0>", "000000><0000<<<0<0000>>000<0>00<0>00>", "0><0000<000>0<<0>>000000<<>000<00<0>0", "000>0>0><000<0<000<<000<<0>000<<<>000", "<0>00>000>>0>00000>0<0<000><0<0>0000>", "0000>>0<<00000<00>00<>>00<00<00<0100<", "<0<00<0<<0>000<0><000<00<>0<><<<<<0<0"}
Returns: 252444672
"101111110011101011011111011100111111"
{"1>>><><><1<>>><><11<<<><1<<>><1<>>>>>", "<1><><<11<><>><>1<><1>>><1<><<><<>>><", "><<1<<>>><>>>0>>>1>>1<<1><><<<><>1<<>", "><><<<<<<>1>><<<1<<1<<<<><<>>>>0>>111", "><1<>1<1<1<>>>>10<><>><<>10<<<<>>>1>>", "01>1<<><>><><<>>>><1<1<<>><>1><0<><<1", "<>1>><<>1>><<>><>><<<>><<><>><>>>>>0<", "<<><<<>0<>111<>1<11><><1>>0<<<><<>>>1", ">1<<<>>><<1>><<1><>1>1<>1><1><>><<1>0", "<><<<<>1>0>><<<<1<<<><<>><<10><<><01<", "1><>>>>1<<1>11<><<>1<><<<>><><<<<1>>>", "<>>0>>1<<><<><<1>>>>><>>1><<1<>0<>>>>", ">10><<<1>>>>1<<1><>>1><0<>1<11<><<>1>", ">1<<><<><<<<<<<<><>1>1<<<1>>11>><>>0>", ">>>1<><<0><1<><1>><111>>>>111<<>><>1<"}
Returns: 2165
"111111110111111111111111111111111111"
{"11111<1111111111111111>1111111>111111", "11111111111111111111>101011<111111111", "11111>11111111<111111>1101111111111<1", "11111<1111111110111111111111111>11111", "11111111111<<100111111>11111111111111", "11111111>1111111>1111>111<11111111111", "11111>111<<1111<111111111111111111111", "101111<110111111<111111111111111<1<11", "11111111111110111111111111>111011>111", "101>111111110011111111>11111111111111", "111>11<11<1111111<11<1111111111111111", "11111>111111111111<111111<1111><11<11", "1111011111111111111<111111111>1111111", "1111111111111111>1111011111<1<>111<11", "111111111111111111111<1>11111111111>1"}
Returns: 19584
"000000000010000010010011000001100100"
{"0000010000000000100010000000001001000", "000000000000100000011001001000000<000", "0000000000>00000000000000000000000000", "00000000100>0100001000000001001010<00", "00000000000001100000<0000010000000000", "0000000000010000000<00000100000010000", "00010000000000010100011>0000000001000", "000000<<00000000000000000000010000000", "1001100000000100000<00000000000001000", "1110100000000100000000100<10000000000", "0000010001010000000000100000000000000", "000010000100000000001010>001000<01000", "0001000100010100001000000010001000>01", "0100000000000>00100<0100000>000010011", "0100001000000000001001000000000000000"}
Returns: 370
"010010100011011011010110110101011111"
{"<>><<>>><<<1<>>><<<<><><>>>>>>>><>1>>", "><><><>>1<<<>>>1><<><>>><>0>><><>><<<", "1>>><><<<><><><<><<><<<<><<>1>><>011<", "<<>><>>><<>><><<>>>>1>><>1<<<><><<><>", "1<><><0<><1<><>1><<<<>>>1><><>><><>0<", ">><><1<<<<<>1><>>><>>><<><>><><<>><<<", "<<><>1<<><1><><><>00>>>>0>>>>>><>>1>>", ">>>><>>><><><0<<>>><<<>><>><>><<<><><", ">>>1<<<1><>><><<<><<1><<>><1<<<<<<><<", "<<<<><<><<<>1<>>>>>>><><><<0><>0><>>>", "><>>1<>>><1<><0>>>><<<0><>>1<1<><<>><", "<1><<>><>1<<><><<<<<>1<1><>><><<>><<>", ">>>0<<<<1>0><<>1>0><><<1><<0<<>1><>><", "<<><><><>>><>1<<<1>>><<>>><<<<>1><>>>", ">>1<>>>><><<<><<><>0<<<<>1<<<<<<<<<<<"}
Returns: 65
"000000000000000101000000000000000000"
{"0001000000010000000000000001000000000", "0100000000001000>00000000010000000000", "1000001000000010000000000010000000000", "0000000000000010000010>00000000000000", "000>0000001000000000000000000>0000000", "0100000000000000000000000000000000000", "000>00001000001000<0000>0001000<0>000", "0000000000100000000000000000>00000000", "0000000>00000000000>00000000000000000", "0000100010000000010000000000000000000", "010000000000>000000000000000001>000>0", "0000000000001000000000000010000000000", "000>00000000001000000000010000000000>", "0010000000000001>100001000>0000000001", "00000000000010>1000000000000000000010"}
Returns: 8703
"000000000000000010001000100000000001"
{"01011>00>000<00>0010>010<0>0<<10>0000", "0>001>0>10<0<0<000000000<0<00<<00>00<", "001000><>0<00000<110<>101>>00100>0>>0", "0>><00<0>000>00<>101000<1<<100>><>000", "0>000100>11<001<1>00<00000>0<00011<0>", "<0<0>0<><0101000<10<<00<0>1000<<<>000", "<000<1<<0<0<00100<00>0<00>000>000000<", "00<<000<0<11><00000<000000>><1><000<0", "0100000<<100<00<00<110<0000>>00000>>>", "00111001><00<0><0000001000<0>0<00<00>", ">1000<0>00101<01100>0<00<00<00100<101", "<000001<0<1>000>>10<0<>01>>0<<>><<10>", "01<1000>00<<00<000>1<00><0>0000000<00", "00<1>000001000010<0><0000>0>00<00<011", "<0001<>100<0>><>00<10>>><01001100000<"}
Returns: 1024
"1"
{"1"}
Returns: 2
"00"
{"11>"}
Returns: 1
"111"
{">>111"}
Returns: 2
"1011"
{"000111111100"}
Returns: 5
"11100"
{"0<1111<1001>00<<00"}
Returns: 12
"000000"
{"0001001001000000000000>11"}
Returns: 6
"1011010"
{"1>110011<11<01>>1>1>0>0>0"}
Returns: 1
"00111000"
{">0000>0001011100010>001>11111<0>00><0", ">>>000"}
Returns: 4
"010001000"
{"0000101100000000000001000>01000000000", "011"}
Returns: 16
"1111110111"
{"0<100011<1001101010101001011111101100", "1010010<0111111011<1011101111>11110>>", "00111101<<"}
Returns: 8
"10001000010"
{"011>11101><001010111<101001>01>0101<0", "111101>>0010><>000000101<11000111101"}
Returns: 11
"111111101111"
{"<><<001>><1<1>><>1><>>>11><<>1>1><><>", "<<<1<<<1<>>1<1<101><11<>>>>>>1<1<1><1", "<1<1<<11<1010>1>>><1<0<0<0>"}
Returns: 84
"1111111101111"
{"11110111011111111>1111>011>11110111>1", "111111<10111111111110<101011010101111", "<111>1111011011101111>0100<1111111101"}
Returns: 104
"11010010001011"
{"1110111000011101001<10101101001110100", "1101011111111<0"}
Returns: 20
"111111111111111"
{"<1<<11101><<<1>1<><1<><0><<>1111>><1<", "<>1>><0><1<<<<1<111><1>11<<<1><1<>"}
Returns: 496
"1011101011110110"
{">1101><11100<10111>0>0110110000>11110", "1010010<>111<1000001<1011011<111111<0", "1110<<0110010<<0001<1<111101110101010", "011011011<111111<0110<<1>110<100>1101", "0>111>1011<1111111001000<<111110111"}
Returns: 16
"11001111111100111"
{"1>11111100111111111011111101110111111", "11101011101101111111101111110100010<1", "1010101011011111011111111011001011111", "<011011111011>01>111001>0011010011111", "01>0111110101"}
Returns: 111
"111101001101000010"
{"11>>><><<<<>>0<<<<><<0>>0<<>0>0><<0><", "0<>>>01>>>><>><><<<>>>><<0<0<<1<<10>0", "><1>>>>><>>>"}
Returns: 15
"0000001000110111001"
{"0>010>1><0<<<>10>0110>101100110>101>0", "10<>10>1><1>1>00>>0<0001<0>1011100100", "0>>><01><10100>>00000001010000001><00", ">1>000<><>00<0>0>1<1>0<<<0>01111011>>", "100<<<>0100110<<<1<10>010111>0<11><>1", "<>0>1>0<>0>0<1011<1<<<1><000>0>110>>1", "<0<>0>11<1110<1<10>11000<>1000>00100>", "<>><001010>0<0<01001<><10><100<10<001", "1<<1>10>01><0<><001<000><10>000<<1><>", "000>00>"}
Returns: 48
"10111011111010100111"
{"0110111111111001000111101110110101001", "0110111101111110101111111110110101111", "0111011101111011111101111111111010010", "0111111010111111011011111111101111101", "1011001111101111011111111101001101000", "0110110111111011111101011011011111101", "1011001111111110111111111101011111111", "1110001111111111111101101111001110111", "1111111110101111111"}
Returns: 21
"000100101110000110101"
{"1>1<<1<0000010>1>1010>010>0>01>1>1>1>", "1111111010<11>1000<<>00<001<111<<1<"}
Returns: 42
"0110100101111000000000"
{"><>11>00>>><<0<>10<0>>><>><"}
Returns: 31
"01111111111111111111011"
{">>>><>>"}
Returns: 1
"111111111111111111111111"
{"<<1>>><<><1"}
Returns: 44
"0100000101000001000000001"
{"100>00000>00>1011010000>00>0000>00000", "000001001000000000000000>100001100010", "1>0>101100000100>00000>01000000100000", "00>001>0>000000>001000>00011010>0000"}
Returns: 42
"01100010000000000000011000"
{"1010<<<<00<"}
Returns: 39
"001000001011001011010101100"
{"1100100100101111110100001111000010101", "0001101000010010110010100100100101001", "0101000000110000000000000001100101000", "1010010011100010010001010110101000000", "0111110000100110010010010110101000100", "1100011101000000010111000010010010010", "0100101001001000000011110010001010011", "0000011001100110010110001100100001001", "0100111000111000010000001100000101011", "0000000101011011010011001101011100000", "0100111010010100010100100001101000000", "1110010010110100110101101110000011100", "001101101"}
Returns: 28
"0000000100000110000101110001"
{"0010001101000000000011010100000100010", "0001010000000000110000101001111000001", "0000100010001000001000000010101000001", "001010000100000000<100001010000000101", "00<001>100000000100010100001100000011", "000000110010<100110100000000>01010001", "001>1010010000000000>"}
Returns: 94
"00000011100000000000000000001"
{"<1>><<>0<<>"}
Returns: 6
"111110011111010001011110001111"
{"0101111111110111>11101101101111101000", "00101000110010111111100011100101<00<1", "1011111110<10011>1111101111>111010111", "110111110001111111110<1110011111"}
Returns: 138
"0100000100000100001010000000100"
{"0001>0>00>>00>00000100>>0000110100000", "000000001101>0>>>0>000>11101>000><001", ">0001>1010000000100000010000>01000001", ">0000000>0>01010>0<>10000001010101>00", "00<0<1110>00>100000100>0>1>1000>00>>1", "0000100110000000011000000010010>100<0", "0><00010<"}
Returns: 65
"11111111011111111111110011111111"
{"1111>11101011111>>>111111111111011111", "11111>11>111>111>1111111101>10>11<1>1", "1100111111100111101>11>0101111111>1>1", "11>"}
Returns: 17428
"110011111011111111111110110111011"
{"111<<<<1><101<11<0011<<1111>1<<100<<<", "0101<<<<10<<110>1<<<100>001>101111111", "0<"}
Returns: 552
"0000000100001000000100010000101110"
{">><><>><>01<<>>>>>><><0>>>>><1>>0><0<", ">0<0<>>>>>>><<<><>>>>><<>>>0><<0<0><>", "><>>>>>>>1<>><<><00<<0<>><>><<>>>0<<0", "0>0>>>><>><>><"}
Returns: 4
"10000001011111010001000110110001000"
{"0001011111001101010111010001100011101", "00000>0010110111001100101111101000000", "0010000110010111100011100010011110000", "00110000>0000000110000100101110100110", "011>010010<00110000101000001000100111", "00010101110010001110<1101001>00011110", "0110011001000101000110<11101000010000", "0010001100011000110001100000101000111", "110011101101>100<11100011000101010010", "1000001"}
Returns: 154
"000000000000000000000000000000000000"
{">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"}
Returns: 0
"111111111111111111111111111111111111"
{"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"}
Returns: 0