結果

問題 No.2270 T0空間
ユーザー 👑 p-adic
提出日時 2023-01-17 15:44:27
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,409 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 67,108 KB
最終ジャッジ日時 2025-02-10 04:02:58
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;

#define CIN( LL , A ) LL A; cin >> A 
#define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) 
#define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( remove_const<remove_reference<decltype( FINAL_PLUS_ONE )>::type >::type 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 RETURN( ANSWER ) cout << ( ANSWER ) << "\n"; QUIT 

#include <cassert>

#define MAIN main

int MAIN()
{
  UNTIE;
  constexpr const int bound_N = 11;
  CIN( int , N );
  assert( 0 <= N && N < bound_N );
  constexpr const int bound_M = 1024;
  int ambient = ( 1 << N ) - 1;
  CIN( int , M );
  assert( 0 <= M && M <= ambient );
  bool O[bound_M] = {};
  int U[bound_M];
  int Lm;
  int Ai;
  FOR( m , 0 , M ){
    int& Um = U[m];
    Um = 0;
    cin >> Lm;
    assert( Lm > 0 );
    REPEAT( Lm ){
      cin >> Ai;
      assert( ( Um & ( 1 << Ai ) ) == 0 );
      Um |= 1 << Ai;
    }
    assert( ! O[Um] );
    O[Um] = true;
  }
  bool searching;
  FOR( n0 , 1 , N ){
    FOR( n1 , 0 , n0 ){
      searching = true;
      FOR( m , 0 , M ){
	if( ( ( U[m] >> n0 ) & 1 ) != ( ( U[m] >> n1 ) & 1 ) ){
	  searching = false;
	  break;
	}
      }
      if( searching ){
	RETURN( "No" );
      }
    }
  }
  RETURN( "Yes" );
}
0