|
|
back to boardmy solution #include <iostream> #include <cstdlib> #include <cmath> int main(){ long N; long *array;
std::cin >> N; array = ( long * )malloc( sizeof( long ) * N );
for( long i = 0; i < N; i++ ) std::cin >> array[ i ];
for( long i = 0; i < N; i++ ) std::cout << ( floor( ( 1 + sqrt( 1 + 8.0 * ( array[ i ] - 1 ) ) ) / 2 ) == ( ( 1 + sqrt( 1 + 8.0 * ( array[ i ] - 1 ) ) ) / 2 ) ) << ' ';
free( ( void * )array ); } |
|
|