結果
| 問題 | No.2766 Delicious Multiply Spice |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:36:16 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,120 ms |
| コンパイル使用メモリ | 211,224 KB |
| 実行使用メモリ | 12,020 KB |
| 最終ジャッジ日時 | 2026-07-04 19:41:01 |
| 合計ジャッジ時間 | 2,476 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}