結果
問題 |
No.2766 Delicious Multiply Spice
|
ユーザー |
![]() |
提出日時 | 2024-06-04 04:05:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 1,928 ms |
コンパイル使用メモリ | 194,744 KB |
最終ジャッジ日時 | 2025-02-21 19:25:34 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 8 |
other | AC * 23 TLE * 1 -- * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { long long N; cin >> N; string Ans; auto f = [&](auto f, long long X, string S) -> void { if (X == N) { Ans = S; return; } if (X > N) return; f(f, X * 2 + 1, S + 'A'); f(f, X * 3 + 1, S + 'B'); }; f(f, 1, ""); cout << Ans << endl; }