// 誤解法(O(N^2)愚直解)チェック #pragma GCC optimize ( "O3" ) #pragma GCC optimize( "unroll-loops" ) #pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" ) #include #include #include #include using namespace std; #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 const 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 FOREQINV( VAR , INITIAL , FINAL ) for( TYPE_OF( INITIAL ) VAR = INITIAL ; VAR >= FINAL ; VAR -- ) #define QUIT return 0 #define COUT( ANSWER ) cout << ( ANSWER ) << "\n" int MAIN() { UNTIE; CEXPR( int , bound_N , 100000 ); CIN_ASSERT( N , 1 , bound_N ); string Yes = "Yes"; string No = "No"; bool P[bound_N]; FOR( i , 0 , N ){ CIN( string , Pi ); P[i] = ( Pi == Yes ); } bool X; FOR( R , 0 , N ){ X = true; FOREQINV( L , R , 0 ){ X = ( P[L] == X ); } COUT( X ? Yes : No ); } QUIT; }