結果

問題 No.2766 Delicious Multiply Spice
ユーザー GOTKAKO
提出日時 2024-05-31 21:23:52
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 1,999 ms
コンパイル使用メモリ 193,920 KB
最終ジャッジ日時 2025-02-21 17:26:00
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6 WA * 2
other AC * 9 WA * 2 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long N; cin >> N;
    string answer = "";
    while(N != 1){
        long long left = (N-1);
        if(left%2 == 0) answer += "A",N = --N/2;
        else answer += "B",N = --N/3;

    }
    reverse(answer.begin(),answer.end());
    cout << answer << endl;
}
0