Result

AC

Code [DL]

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

stdin

11111101
00100100
00001110
00100100
10111010
00000110
00000001
10011010
10111110
00101100
11110110
01011011
01110010
10101011
11100111
00101101
01101000
00101101
10111011
10011011
01001110
01111000
00110101
00000100
11000000
11111111
00010001
01101101
00101110
01101001
01000010
10001000
11110111
10011001
11101001
00001111
10010010
00000011
01001101
00001010
00011100
00111111
01001000
00110111
01110110
00000000
00010011
11010010
10010111
00010101

stdout

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

stderr

strace