結果
| 問題 | 
                            No.2766 Delicious Multiply Spice
                             | 
                    
| コンテスト | |
| ユーザー | 
                             naut3
                         | 
                    
| 提出日時 | 2024-06-01 01:25:11 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 539 bytes | 
| コンパイル時間 | 17,142 ms | 
| コンパイル使用メモリ | 384,076 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-12-21 03:16:48 | 
| 合計ジャッジ時間 | 18,677 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 6 WA * 2 | 
| other | AC * 10 WA * 21 | 
ソースコード
#![allow(non_snake_case, unused_imports)]
use proconio::{fastout, input, marker::*};
#[fastout]
fn main() {
    input! {
        mut N: usize,
    }
    let mut ans = vec![];
    while N != 1 {
        if (N - 1) % 2 == 0 {
            N = (N - 1) / 2;
            ans.push('A');
        } else {
            N = (N - 1) / 3;
            ans.push('B');
        }
    }
    ans.reverse();
    println!(
        "{}",
        ans.iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join("")
    );
}
            
            
            
        
            
naut3