find value of rows having first column value equal to zero
int ans = 0 ; for ( int i = 0 ; i < n ; ++ i ) { if ( A [ i , 0 ] == 0 ) { ans = 0 ; for ( int j = 1 ; j < m ; ++ j ) ans = ( int ) ( ans + A [ i , j ] * Math . Pow ( 2 , m - j - 1 ) ) ; update . Add ( ( int ) ans , i ) ; } }