結果
| 問題 | No.2766 Delicious Multiply Spice |
| コンテスト | |
| ユーザー |
Moss_Local
|
| 提出日時 | 2024-05-31 23:09:21 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 11,334 ms |
| コンパイル使用メモリ | 185,700 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-27 19:59:01 |
| 合計ジャッジ時間 | 2,624 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 WA * 2 |
| other | AC * 10 WA * 21 |
ソースコード
use std::io;
fn main() {
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.expect("Failed to read line");
let mut n: u64 = input.trim().parse().expect("Not a number");
let mut result = Vec::new();
while n > 1 {
if n % 2 == 1 {
result.push('A');
n = (n - 1) / 2;
} else {
result.push('B');
n = (n - 1) / 3;
}
}
result.reverse();
let result: String = result.iter().collect();
println!("{}", result);
}
Moss_Local