結果
問題 |
No.2766 Delicious Multiply Spice
|
ユーザー |
|
提出日時 | 2024-05-31 21:36:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 2,351 ms |
コンパイル使用メモリ | 194,276 KB |
最終ジャッジ日時 | 2025-02-21 17:34:40 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 6 |
other | WA * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; string adjust_taste(int N) { string steps = ""; while (N != 1) { if (N % 2 == 0) { N /= 2; steps += 'A'; } else { N = (N - 1) / 2; steps += 'B'; } } reverse(steps.begin(), steps.end()); return steps; } int main() { int N; cin >> N; string steps = adjust_taste(N); cout << steps << endl; return 0; }