結果
| 問題 |
No.2766 Delicious Multiply Spice
|
| コンテスト | |
| ユーザー |
Moss_Local
|
| 提出日時 | 2024-05-31 23:04:52 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 551 bytes |
| コンパイル時間 | 16,192 ms |
| コンパイル使用メモリ | 382,212 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-21 01:20:54 |
| 合計ジャッジ時間 | 16,243 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 WA * 2 |
| other | AC * 4 WA * 27 |
ソースコード
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 - 1) % 2 == 0 {
result.push('A');
n = (n - 1) / 2;
} else {
result.push('B');
n = (n - 2) / 2;
}
}
result.reverse();
let result: String = result.iter().collect();
println!("{}", result);
}
Moss_Local