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 != `EOF) 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

00011101
11111101
00110001
01111000
01101111
00010101
01001110
00000000
11001100
01000010
01011001
01000010
10111110
11100111
11000111
01110000
10101011
10100100
00100100
00000011
00000110
01100111
01000110
01011011
00000001
00010000
00001010
10011001
11010010
10000010
11010101
01111010
00000101
01101001
01111011
00101101
00000000
11101101
00110111
00011001
10111010
10001000
01000000
10101001
00111000
01001100
00011011
00011100
00101010
00001111

stdout

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

stderr

strace