Result

AC

Code [DL]

`define EOF 32'hFFFF_FFFF
`define STDIN 32'h8000_0000
module cat;integer c,i,d;initial begin c=$fgetc(`STDIN);while(!(&c))begin d=0;i=1;while(c==48||c==49)begin d=d*2;d=d+c-48;c=$fgetc(`STDIN);end i=1;while(d>0)begin d=d-i;i=i+1;end if(d==0)begin $write("%c\n","1");end else begin $write("%c\n","0");end c=$fgetc(`STDIN);end end endmodule

stdin

00001110
10111011
01111000
00011110
10111110
10110010
10101100
00101101
10001000
00110111
00010101
00000001
01110011
01011011
00011100
11111101
01000101
00000110
00100100
10011000
10110101
00000011
00000000
01001110
01001110
00001010
11010000
01101000
11101001
10011111
11100100
10011001
01011011
10100001
00101010
01101110
10101000
00001111
01000010
11000000
01100000
00011101
10101011
01101001
10001011
10000111
11010110
01101010
11100111
11010010

stdout

0
0
1
0
1
0
0
1
1
1
1
1
0
1
1
1
0
1
1
0
0
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
1
1
0
0
0
1
1
0
0
0
0
1
1

stderr

strace