Result

AC

Code [DL]

module a;integer i,j,x,c;initial repeat(50)begin c=$fscanf(1<<31,"%b",x);for(j=0;j<=x;j=j+1)c=c+(j*j+j==2*x);$write("%d",c-1);end endmodule

stdin

11101001
10111110
11100110
00001010
00011111
00101000
11011010
11001100
10000111
01010011
10100001
00000000
10110100
00010101
10111110
10011001
10011010
11000011
01101010
00000110
10000000
11001111
10101011
01001110
10101100
00100100
00000011
11100111
01000010
10111001
01001101
11011101
11010010
11010111
00110111
11111101
00000001
11101010
00001111
01011100
01100010
00101101
01101001
00011100
00000001
00001001
01111000
10001000
11010001
01011011

stdout

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

stderr

strace