結果

問題 No.2766 Delicious Multiply Spice
ユーザー winguwingu
提出日時 2024-05-31 21:36:19
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,469 bytes
コンパイル時間 3,668 ms
コンパイル使用メモリ 247,688 KB
実行使用メモリ 516,448 KB
最終ジャッジ日時 2024-05-31 21:36:30
合計ジャッジ時間 6,948 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,760 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 WA -
testcase_19 MLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/modint>
using namespace atcoder;
#ifdef DEFINED_ONLY_IN_LOCAL
#include <dump.hpp>
#define dump(...) cpp_dump(__VA_ARGS__)
#else
#undef dump
#define dump(...)
#endif
template<class T>inline bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep1(i,a) for(int i=0;i<(int)(a);i++)
#define rep2(i,a,b) for(int i =(int)(a);i<(int)(b);i++)
#define rep3(i,a,b,c) for(int i=(int)(a);i<(int)(b);i+=(int)(c))
#define overloadRep(a,b,c,d,e,...)e
#define rep(...) overloadRep(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
#define rrep(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define drep(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
using P=pair<long,long>;
using T=tuple<long,long,long>;
const int inf=1e9;
const long INF=1e18;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
bool bit(long x, int p){return (x>>p)&1;}
bool out(int ni, int nj, int h, int w){return (ni<0 or ni>=h or nj<0 or nj>=w);}
int pc(long x){return __builtin_popcountl(x);}
using mint=modint998244353;

int main(){
    long n;cin>>n;

    string ans;
    while(n!=1){
        if((n-1)&1){
            ans+='B';
            n=(n-1)/3;
        }else{
            ans+='A';
            n=(n-1)/2;
        }
    }
    reverse(all(ans));
    cout<<ans<<endl;
    return 0;
}
0