結果

問題 No.2270 T0空間
ユーザー 👑 p-adicp-adic
提出日時 2023-01-17 15:44:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,409 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 69,944 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-06 11:08:13
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
権限があれば一括ダウンロードができます

ソースコード

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