Result

AC

Code [DL]

while a = gets()
c = a.to_i
b = 0
i = 0
while i<8
r = c % 10
c /=  10
b+=r*(2**i)
i+=1
end
i = 1
while b > 0
b -= i
i+=1
end
if b ==0
puts(1)
else
puts(0)
end
end

stdin

11001001
00111011
00000001
11011111
00001000
00011100
10011001
10010001
01010110
00001111
00110111
00101101
10001000
11010010
00100100
00000011
00010101
11100111
00111000
10101010
10101011
01110110
01010000
11101110
01111011
01001110
10101111
01010010
11110111
01000010
11010111
11111101
11100010
00010010
11001110
00011001
01101001
00000110
00101011
11000011
11001101
01011011
10000100
00000000
00001010
10001001
01111000
10111110
00100100
00000001

stdout

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

stderr

strace