Result

AC

Code [DL]

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;}char s[9];main(){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);}}

stdin

00101101
00001101
01001110
01011011
01101000
00110111
00010101
00000011
00011110
01000100
11010010
01110000
11110011
01100111
00000000
00001010
01000010
01011001
01111000
00000000
10111110
01101001
00100100
01110100
00001111
00000110
10011110
01001100
01010111
10001000
10001111
10101011
01000101
11101000
10011001
10010110
11000010
01001000
01010010
10001001
01011011
01100000
11111101
11100111
00011100
00001011
00000001
11110000
00101100
00011111

stdout

10110111001000111011111011000101001000001011101000

stderr

/tmp/code.c:1:116: warning: return type defaults to ‘int’ [-Wimplicit-int]
 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;}char s[9];main(){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);}}
                                                                                                                    ^
/tmp/code.c: In function ‘main’:
/tmp/code.c:1:145: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 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;}char s[9];main(){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);}}
                                                                                                                                                 ^
/tmp/code.c:1:145: warning: incompatible implicit declaration of built-in function ‘scanf’
/tmp/code.c:1:145: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
/tmp/code.c:1:238: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 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;}char s[9];main(){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);}}
                                                                                                                                                                                                                                              ^
/tmp/code.c:1:238: warning: incompatible implicit declaration of built-in function ‘printf’
/tmp/code.c:1:238: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

strace