// 誤解法(Nが小さい場合も乱択して一致判定せず)チェック #include #include #include #include using namespace std; #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 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 QUIT return 0 #define RETURN( ANSWER ) cout << ( ANSWER ) << "\n"; QUIT #include #define MAIN main int MAIN() { UNTIE; const string ab[2] = { "a" , "b" }; CEXPR( int , bound_N , 100000 ); CIN_ASSERT( N , 1 , bound_N ); srand( time( NULL ) ); FOR( i , 0 , N ){ cout << ab[rand() % 2]; } RETURN( "" ); }