Result

AC

Code [DL]

#include<stdio.h>
int m(int x) {
    int lb = 0;
    int ub = x;
    while((ub - lb) > 1) {
        int mb = (ub + lb) / 2;
        if (mb * mb > x)ub = mb;
        else lb = mb;
    }
    return lb;
}

int main() {
    char s[9];
    for(int i=0;i<50;i++) {
        scanf("%s", s);
        int x=0;
        for(int j=0; j<8;j++)
        {
         x *= 2; x += (s[j]=='1');
        }
        int y = 1 + 8 * x;
        int z = y!=1 ? m(y):1;
        printf("%d", z * z / y);
    }
    return 0;
}

stdin

00110111
10111110
10001000
10001011
10100000
00000000
11110100
01111000
00011100
11100001
10100011
10101011
00000001
11110010
11010010
10111110
00110111
11100111
10011001
10101110
01001110
01011010
11111101
01010011
01000010
00101001
00110010
01011110
00001010
10000011
00000100
01011011
11111111
00010000
10101000
01101001
00000110
10111111
10000101
00001111
00000011
00100100
01011101
01101101
01010000
11101100
10001001
10111000
00010101
00101101

stdout

11100101100110111110101010001001000110011100000011

stderr

/tmp/code.c: In function ‘main’:
/tmp/code.c:16:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s", s);
         ^

strace