結果

問題 No.2766 Delicious Multiply Spice
ユーザー wingu
提出日時 2024-05-31 21:36:19
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,469 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 246,548 KB
実行使用メモリ 501,860 KB
最終ジャッジ日時 2024-12-20 22:44:07
合計ジャッジ時間 31,830 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6 WA * 2
other AC * 10 WA * 12 TLE * 9
権限があれば一括ダウンロードができます

ソースコード

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