by@cookies146
AC
import std.stdio; import std.array; import std.math; import std.conv; bool issq(int a) {return cast(int)sqrt(cast(real)a)*cast(int)sqrt(cast(real)a) == a;} bool tri(int a) {return issq(8*a+1)&&(cast(int)sqrt(8.0*a+1) % 2);} void main() { string s; while ((s = readln()).length > 3) { int i = to!int(split(s)[0],2); if(tri(i)) { writeln("1"); } else { writeln("0"); } } }
11100100 00110100 10100111 01100111 10001000 00001010 10100001 01000010 11010010 00000001 11111101 11000110 00001111 10010101 01111110 11111100 11100111 11001111 00100100 00000101 01111111 01010011 00001010 01100000 00000000 01111000 01101001 01101011 01111000 11010100 10101010 10011001 10111110 01010001 01011011 01001110 10101001 00101101 11001011 00000111 11111000 10101011 00000011 01100101 11101110 00010101 00110111 10100011 00011100 00000110
0 0 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1