結果

問題 No.2098 [Cherry Alpha *] Introduction
ユーザー 👑 p-adicp-adic
提出日時 2022-10-14 21:33:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 4,412 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 202,172 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 13:15:50
合計ジャッジ時間 2,660 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

using uint = unsigned int;
using ll = long long;

#define TYPE_OF( VAR ) remove_const<remove_reference<decltype( VAR )>::type >::type
#define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr ) 
#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 GETLINE( A ) string A; getline( cin , A ) 
#define GETLINE_SEPARATE( A , SEPARATOR ) string A; getline( cin , A , SEPARATOR ) 
#define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( TYPE_OF( FINAL_PLUS_ONE ) VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ ) 
#define FOREQ( VAR , INITIAL , FINAL ) for( TYPE_OF( FINAL ) VAR = INITIAL ; VAR <= FINAL ; VAR ++ )  
#define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) 
#define REPEAT( HOW_MANY_TIMES ) FOR( VARIABLE_FOR_REPEAT , 0 , HOW_MANY_TIMES ) 
#define QUIT return 0 
#define RETURN( ANSWER ) cout << ( ANSWER ) << "\n"; QUIT 
#define DOUBLE( PRECISION , ANSWER ) cout << fixed << setprecision( PRECISION ) << ( ANSWER ) << "\n"; QUIT 
#define MIN( A , B ) ( A < B ? A : B )
#define MAX( A , B ) ( A < B ? B : A )
#define RESIDUE( A , P ) ( A >= 0 ? A % P : P - ( - A - 1 ) % P - 1 )

#define POWER( ANSWER , VAR , EXPONENT_REF , MODULO )			\
  TYPE_OF( VAR ) ANSWER = 1;						\
  TYPE_OF( VAR ) VARIABLE_FOR_SQUARE_FOR_POWER = VAR;			\
  while( EXPONENT_REF != 0 ){						\
    if( EXPONENT_REF % 2 == 1 ){					\
      ANSWER = ( ANSWER * VARIABLE_FOR_SQUARE_FOR_POWER ) % MODULO;	\
    }									\
    VARIABLE_FOR_SQUARE_FOR_POWER = ( VARIABLE_FOR_SQUARE_FOR_POWER * VARIABLE_FOR_SQUARE_FOR_POWER ) % MODULO;	\
    EXPONENT_REF /= 2;							\
  }									\


#define BS( ANSWER , MINIMUM , MAXIMUM , EXPRESSION , TARGET )		\
  ll VARIABLE_FOR_BINARY_SEARCH_L = MINIMUM;				\
  ll VARIABLE_FOR_BINARY_SEARCH_U = MAXIMUM;				\
  ll ANSWER = VARIABLE_FOR_BINARY_SEARCH_U;				\
  ll VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH = TARGET - EXPRESSION;	\
  if( VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH == 0 ){			\
    VARIABLE_FOR_BINARY_SEARCH_L = ANSWER;				\
  } else {								\
    ANSWER = ( VARIABLE_FOR_BINARY_SEARCH_L + VARIABLE_FOR_BINARY_SEARCH_U ) / 2; \
  }									\
  while( VARIABLE_FOR_BINARY_SEARCH_L != ANSWER ){			\
    VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH = TARGET - EXPRESSION;	\
    if( VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH == 0 ){		\
      VARIABLE_FOR_BINARY_SEARCH_L = ANSWER;				\
      break;								\
    } else {								\
      if( VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH > 0 ){		\
	VARIABLE_FOR_BINARY_SEARCH_L = ANSWER;				\
      } else {								\
	VARIABLE_FOR_BINARY_SEARCH_U = ANSWER;				\
      }									\
      ANSWER = ( VARIABLE_FOR_BINARY_SEARCH_L + VARIABLE_FOR_BINARY_SEARCH_U ) / 2; \
    }									\
  }									\


#define BS2( ANSWER , MINIMUM , MAXIMUM , EXPRESSION , TARGET )		\
  ll VARIABLE_FOR_POWER_BINARY_SEARCH_2 = 1;				\
  ll VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH = MAXIMUM - MINIMUM;	\
  while( VARIABLE_FOR_POWER_BINARY_SEARCH_2 <= VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH ){		\
    VARIABLE_FOR_POWER_BINARY_SEARCH_2 *= 2;				\
  }									\
  VARIABLE_FOR_POWER_BINARY_SEARCH_2 /= 2;				\
  ll VARIABLE_FOR_ANSWER_FOR_BINARY_SEARCH_2 = MINIMUM;			\
  ll ANSWER;								\
  while( VARIABLE_FOR_POWER_BINARY_SEARCH_2 != 0 ){			\
    ANSWER = VARIABLE_FOR_ANSWER_FOR_BINARY_SEARCH_2 + VARIABLE_FOR_POWER_BINARY_SEARCH_2; \
    VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH = TARGET - EXPRESSION;	\
    if( VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH == 0 ){		\
      break;								\
    } else if( VARIABLE_FOR_DIFFERENCE_FOR_BINARY_SEARCH > 0 ){		\
      VARIABLE_FOR_ANSWER_FOR_BINARY_SEARCH_2 = ANSWER;			\
      VARIABLE_FOR_POWER_BINARY_SEARCH_2 /= 2;				\
    }									\
  }									\
									\


template <typename T> inline T Absolute( const T& a ){ return a > 0 ? a : - a; }

int main()
{
  string name[5] =
    {
      "Zelkova and Cherry" ,
      "BANNED CONTEST" ,
      "Stray Bullet",
      "Early Summer Rain",
      "Do you know Cherry Contest?",
    };
  string version[5] =
    {
      "1st" ,
      "2nd" ,
      "3rd" ,
      "4th" ,
      "Alpha"
    };
  GETLINE( S );
  FOR( i , 0 , 5 ){
    if( S == name[i] ){
      RETURN( version[i] );
    }
  }
  RETURN( "NO" );
}
0