結果

問題 No.2098 [Cherry Alpha *] Introduction
ユーザー namakoiscatnamakoiscat
提出日時 2022-10-14 21:31:04
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 9,562 bytes
コンパイル時間 2,465 ms
コンパイル使用メモリ 212,528 KB
実行使用メモリ 9,752 KB
最終ジャッジ日時 2023-09-08 20:19:58
合計ジャッジ時間 3,082 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,516 KB
testcase_01 AC 4 ms
9,592 KB
testcase_02 AC 5 ms
9,524 KB
testcase_03 AC 4 ms
9,444 KB
testcase_04 AC 5 ms
9,472 KB
testcase_05 AC 4 ms
9,532 KB
testcase_06 AC 5 ms
9,660 KB
testcase_07 AC 4 ms
9,512 KB
testcase_08 AC 4 ms
9,452 KB
testcase_09 AC 4 ms
9,528 KB
testcase_10 AC 4 ms
9,648 KB
testcase_11 AC 4 ms
9,752 KB
testcase_12 AC 4 ms
9,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* 

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

int main(){

*/

// __builtin_popcount() ;
// multiset ;
// unordered_set ;
// reverse ;

/*

    #include <atcoder/all>
    using namespace atcoder ;

*/


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


/*

    #include<boost/multiprecision/cpp_int.hpp>
    using namespace boost::multiprecision;
    typedef cpp_int cp ;

*/


//-------型------- 
typedef long long ll;
typedef string st ;
typedef long double ld ;
typedef unsigned long long ull ;
using P    = pair<ll,ll> ;
using Edge = tuple<ll,ll,ll> ;
using AAA  = tuple<ll,ll,ll,ll> ;
//-------型-------  

//-------定数-------  
const ll mod0 = 1000000007;
const ll mod1 = 998244353 ;
const ll LINF =  1000000000000000000 ;  //(10^18)
const ld pai = acos(-1) ;
const ld EPS = 1e-10 ;
//-------定数-------

//-------マクロ------- 
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            x.begin(), x.end()
#define rep(i,a,n)        for (ll i = a; i <= (n); ++i)
#define ketu(i,a,n)       for (ll i = a; i >= (n); --i)
#define re                return 0;
#define fore(i,a)         for(auto &i:a)
#define V                 vector
#define fi                first
#define se                second  
#define C                 cout   
#define E                 "\n";
#define EE                endl;
//-------マクロ------- 

//-------テンプレ文字列-------
st zz     = "abcdefghijklmnopqrstuvwxyz" ;
st ZZ     = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
st tintin = "%" ;
st Y      = "Yes" ; 
st YY     = "No" ;
st at     = "atcoder" ;
st KU     = " " ;
//-------テンプレ文字列-------

void chmin(ll& x ,ll y){x = min(x,y) ;}
void chmax(ll& x ,ll y){x = max(x,y) ;}


vector<ll> Y4 = {0,1,0,-1} ;
vector<ll> X4 = {1,0,-1,0} ;

vector<ll> Y8 = {0,1,1,1,0,-1,-1,-1} ;
vector<ll> X8 = {1,1,0,-1,-1,-1,0,1} ;

 
ll gcd(ll a, ll b){
 
   if(b == 0){
    return a;
}
return gcd(b,a%b) ;
}
 
 
ll lcm(ll a, ll b){
    
    ll ans = a*b /gcd(a,b) ;
    return ans ;
}
 
// true --→ 素数 、false --→ 素数じゃない
bool nis(ll a){
    if(a == 1)return false ;
    if(a == 2)return true ;
    bool flag = true ;
    rep(i,2,sqrt(a)+1){
        if(a%i == 0){
          flag = false ;
          break ;
}
}
 return flag ;   
}

 ll jun(ll a,ll b, ll c,ll rank ){
     
    vector<ll> ANS ;
    ANS.pb(-LINF) ;
    ANS.pb(a) ;
    ANS.pb(b) ;
    ANS.pb(c) ;
    
    sort(all(ANS)) ;
    return ANS[rank] ;
}


//  UF.initはいっかいだけならいいけど、二回目以降はrepで初期化
vector<ll> par;
class UnionFind {
public:
 
  
   
  // サイズをGET!
  void init(ll sz) {
       par.resize(sz,-1);
}
   // 各連結成分の一番上を返す
  ll root(ll x) {
    if (par[x] < 0) return x;
    return par[x] = root(par[x]);
  }
   
  // 結合作業
  bool unite(ll x, ll y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x,y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }
  // 同じグループか判定
  bool same(ll x, ll y) { return root(x) == root(y);}
  // グループのサイズをGET!
  ll size(ll x) { return -par[root(x)];}
};
 
UnionFind UF ;


vector<ll> enumdiv(ll n) { 
    vector<ll> S;
    for (ll i = 1; i*i <= n; i++) if (n%i == 0) { S.pb(i); if (i*i != n) S.pb(n / i); }
    sort(S.begin(), S.end());
    return S;
}
 
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using max_priority_queue = priority_queue<T, vector<T>, less<T>> ;
// 使用例 min_priority_queue<ll (ここは型)> Q ;


vector<pair<long long, long long>> prime_factorize(long long N){
    vector<pair<long long, long long>> res;
    for(long long a = 2; a * a <= N; ++a){
        if(N % a != 0) continue;
        long long ex = 0;
        while(N % a == 0) ++ex, N /= a;
        res.push_back({a,ex});
    }
    if(N != 1) res.push_back({N,1});
    return res;
}




ll binpower(ll a, ll b,ll c) {
	ll ans = 1;
	while (b != 0) {
		if (b % 2 == 1) {
			ans = (ans)*a % c;
		}
		a = a*a % c;
		b /= 2;
	}
	return ans;
}


// 区間に関する問題きたら[a,b] を [1,b] - [1,a] と分解しよう
ll countMultiple(ll R, ll div, ll mod) { // [1,R] and x % div == mod
	if (R == 0) return 0;
 
	ll res = R / div;
	if (mod <= R % div and 0 < mod) res++;
	return res;
}


template<typename T>
V<T> sr(V<T> A){
      sort(all(A)) ;
      reverse(all(A)) ;
      
      return  A ;
}



// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division

const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct sqrt_machine{
    
    V<ll> A ;
    const ll M = 1000000 ;
    void init(){
        A.pb(-1) ;
        rep(i,1,M){
            A.pb(i*i) ;
        }
        A.pb(LINF) ;
    }
  

    bool scan(ll a){
        ll pos = lower_bound(all(A),a) - A.begin() ;
        if(A[pos] == -1 || A[pos] == LINF || A[pos] != a)return false ;
        return true ;
    }
    
};

struct SpakringBlackCocoa_Tree{
       

};



sqrt_machine SM ;

ll a_b(V<ll> A,ll a,ll b){
   ll res = 0 ;
   res += upper_bound(all(A),b) - lower_bound(all(A),a) ;
   return res ;
}


struct era{
       ll check[10000010] ;
       
       void init(){
            rep(i,2,10000000){
                if(check[i] == 0){
                    for(ll j = i + i ;j <= 10000000 ; j += i){
                        check[j] ++ ;
                    }
                }
            }
       }
       
       bool look(ll x){
            if(x == 1)return false ;
            if(check[x] == 0)return true ;
            else return false ;
       }
       
       ll enu_count(ll x){
          if(x == 1)return 1 ;
          if(check[x] == 0)return 1 ;
          return check[x] ;
       }
    
};

era era ;

st ten_to_two(ll x){
   st abc = "" ; 
   if(x == 0){
       return  "0" ;
   } 
   
   while(x > 0){
       abc = char(x%2 + '0') + abc ;
       x /= 2 ;
   }
   
   return abc ;
}

ll two_to_ten(st op){
   ll abc = 0 ;
   ll K = op.size() ;
   for(ll i = 0 ;i < K ;i++){
       abc = abc * 2 + ll(op[i] - '0') ;
   }
   return abc ;
}

V<ll> G[220000] ;

int main(void){ 
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

//         SM.init() ;
//         era.init() ;

// nis(ll a) 素数判定  素数ならtrue
// jun(ll a,ll b,ll c, ll d) 三つのなかのd番目
// gcd(ll a , ll b) gcd 
// lcm(ll a ,ll b ) lcd 
// UF  UF.init(ll N) ; UF.root(i) ; UF.unite(a,b) ; UF.same(a,b) ; UF.size(i) ;
// enumdiv(ll a )約数列挙
// prime_factorize(ll p) aのb乗のかたちででてくる 配列で受け取る
// bfs(ll N , ll a ) N = 頂点数 , a = 始点 
// binpower(a,b,c) aのb条 をcでわったやつをO(logb) ぐらいでだしてくれるやつ
// countMultiple(ll R, ll div, ll mod) Rをdivで割った個数を出す関数。 mod で割れる 割りたくなかったら0入れる
// sr(V<ll> A) 配列を入れたら、sort --→ reverse して返してくれる関数  受け取りは auto とかで
// mod0 --→ 1000000007  mod1 --→ 998244353 
// struct  mint  勝手にmod取ってくれるやつ mod は1000000007でやってるので自分で変える
// SM.scan(ll a) で 平方数ならtrue が返ってくる。 範囲は √10^6まで  SM.init() 必ず起動する。
// a_b(A,a,b)  a以上b以下の個数  ---→   upper_bound(all(A),b) - lower_bound(all(A),a) ;
// era.look(ll a) --→ true 素数  / era.enu_count(ll a) --→ 素因数の個数 1は1 、素数も1 その他はそのまんま  範囲は10^7まで
// ten_to_two(ll x) 10進数を二進数にして返す。文字列で出力する事に注意
// two_to_ten(st a) 2進数を10進数にして返す。

// 入力に来てない変数使うとバグる(勝手に知らない数字入ってる)

//          cin >> a >> b >> c >> d >> e >> f ;


// mint 使う時、modどっち使うかちゃんと見る!!!!!!!!!!


ll a,b,c,d,e,f ;



st S ;
cin >>S ;

if(S[0] == 'Z'){
  C << "1st" << E   
}

if(S[0] == 'B'){
    C << "2nd" << E
}

if(S[0] == 'S'){
    C << "3rd" << E
}

if(S[0] == 'E'){
    C << "4th" << E
}

if(S[0] == 'D'){
    C << "Alpha" << E
}







 //          if(dx < 0 || dy < 0 || dx >= W || dy >= H) continue ;
 //          ld p  = sqrt(abs((A[i] - A[j])*(A[i] - A[j])) + abs((B[i] - B[j])*(B[i] - B[j]))) ;
 //          C << fixed << setprecision(10) << 
 
 
re
}
0