結果

問題 No.2270 T0空間
ユーザー 👑 p-adicp-adic
提出日時 2023-01-21 23:03:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,971 bytes
コンパイル時間 830 ms
コンパイル使用メモリ 76,720 KB
実行使用メモリ 5,624 KB
最終ジャッジ日時 2023-09-30 06:07:43
合計ジャッジ時間 8,357 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 20 ms
4,892 KB
testcase_12 AC 11 ms
4,376 KB
testcase_13 AC 42 ms
5,388 KB
testcase_14 AC 42 ms
5,444 KB
testcase_15 AC 42 ms
5,436 KB
testcase_16 AC 75 ms
5,464 KB
testcase_17 AC 138 ms
5,396 KB
testcase_18 AC 137 ms
5,400 KB
testcase_19 TLE -
testcase_20 AC 949 ms
5,416 KB
testcase_21 AC 1,463 ms
5,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 愚直解チェック
#pragma GCC optimize ( "O3" )
#pragma GCC optimize( "unroll-loops" )
#pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" )
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdint.h>
#include <cassert>
using namespace std;

using ull = unsigned long long;

#define MAIN main
#define TYPE_OF( VAR ) remove_const<remove_reference<decltype( VAR )>::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;
	  break;
	}
      }
      if( searching ){
	RETURN( "No" );
      }
    }
  }
  RETURN( "Yes" );
}
0