結果
| 問題 |
No.2270 T0空間
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-01-17 15:44:39 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,422 bytes |
| コンパイル時間 | 536 ms |
| コンパイル使用メモリ | 68,408 KB |
| 最終ジャッジ日時 | 2025-02-10 04:03:04 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 22 |
ソースコード
#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 = 1 << 10;
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;
}
int cap;
int cup;
bool searching;
FOR( n , 0 , N ){
cap = ambient;
cup = 1 << n;
FOR( m , 0 , M ){
if( ( U[m] >> n ) & 1 == 1 ){
cap &= U[m];
} else {
cup |= U[m];
}
}
if( ( ( ~cup ) & cap ) != 0 ){
RETURN( "No" );
}
}
RETURN( "Yes" );
}