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

11100111
01111110
01001100
10000111
01000010
00110111
11111010
01011011
10111110
01000101
11100101
10100011
00101101
00101101
00110010
10001000
11111101
01010100
00010010
10011001
01001110
01100010
01110011
00100100
01000111
00011010
10110010
00001010
11010010
01101001
00011100
00000011
00001111
00010101
11111110
00100111
00000001
01111000
11010100
10101011
10011100
00000110
00001111
10110000
00101010
11101101
10110011
10101110
00000000
10010111

stdout

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

stderr

strace