// 愚直解チェック #pragma GCC optimize ( "O3" ) #pragma GCC optimize( "unroll-loops" ) #pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" ) #include #include #include #include #include using namespace std; using ull = unsigned long long; #define MAIN main #define TYPE_OF( VAR ) remove_const::type >::type #define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) #define CEXPR( LL , BOUND , VALUE ) constexpr LL BOUND = VALUE #define CIN( LL , A ) LL A; cin >> A #define ASSERT( A , MIN , MAX ) assert( ( MIN ) <= A && A <= ( MAX ) ) #define CIN_ASSERT( A , MIN , MAX ) CIN( TYPE_OF( MAX ) , A ); ASSERT( A , MIN , MAX ) #define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( TYPE_OF( FINAL_PLUS_ONE ) VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) #define REPEAT( HOW_MANY_TIMES ) FOR( VARIABLE_FOR_REPEAT , 0 , HOW_MANY_TIMES ) #define QUIT return 0 #define COUT( ANSWER ) cout << ( ANSWER ) << "\n"; #define RETURN( ANSWER ) COUT( ANSWER ); QUIT int MAIN() { UNTIE; CEXPR( int , bound_N , 1 << 8 ); CIN_ASSERT( N , 1 , bound_N ); CEXPR( int , bound_M , 1 << 16 ); CIN_ASSERT( M , 1 , N < 16 ? 1 << N : bound_M ); CEXPR( int , digit , 64 ); CEXPR( int , B , bound_N / digit ); static ull s[bound_M][B] = {}; string one = "1"; FOR( m , 0 , M ){ ull ( &s_m )[B] = s[m]; CIN( string , s_bit ); int i = 0; FOR( b , 0 , B ){ ull& s_mb = s_m[b]; REPEAT( digit ){ if( i >= N ){ break; } ( s_mb <<= 1 ) |= ( s_bit.substr( i , 1 ) == one ? 1 : 0 ); i++; } } } FOR( i , 1 , N ){ FOR( j , 0 , i ){ bool searching = true; FOR( m , 0 , M ){ ull ( &s_m )[B] = s[m]; if( ( ( s_m[i / digit] >> ( i % digit ) ) & 1 ) != ( ( s_m[j / digit] >> ( j % digit ) ) & 1 ) ){ searching = false; } } if( searching ){ RETURN( "No" ); } } } RETURN( "Yes" ); }