結果

問題 No.2766 Delicious Multiply Spice
ユーザー well-defined
提出日時 2024-09-15 13:07:56
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 15,391 ms
コンパイル使用メモリ 378,172 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 13:08:14
合計ジャッジ時間 16,584 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6 WA * 2
other AC * 10 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main () {
    input! {
        mut n: u128,
    }
    let mut ans: Vec<char> = Vec::new();
    while n > 1 {
        if n & 1 == 1 {
            n -= 1;
            n /= 2;
            ans.push('A');
        }
        else {
            n -= 1;
            n /= 3;
            ans.push('B');
        }
    }
    let s = ans.iter()
        .rev()
        .map(|&c| c.to_string())
        .collect::<String>();
    println!("{}", s);
}
0