結果
| 問題 |
No.2766 Delicious Multiply Spice
|
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2024-05-15 17:38:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 346 bytes |
| コンパイル時間 | 2,219 ms |
| コンパイル使用メモリ | 198,720 KB |
| 最終ジャッジ日時 | 2025-02-21 14:14:40 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 23 TLE * 1 -- * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
long long N;
vector<string> ans_all;
void dfs(long long x, string S) {
if(x == N) {
ans_all.push_back(S);
}else if(x < N) {
dfs(2 * x + 1, S + 'A');
dfs(3 * x + 1, S + 'B');
}
}
int main() {
cin >> N;
dfs(1, "");
assert(ans_all.size() == 1);
cout << ans_all[0] << endl;
}
ripity