結果
問題 |
No.2766 Delicious Multiply Spice
|
ユーザー |
![]() |
提出日時 | 2024-05-31 21:26:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 558 bytes |
コンパイル時間 | 2,266 ms |
コンパイル使用メモリ | 199,172 KB |
最終ジャッジ日時 | 2025-02-21 17:28:55 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 8 |
other | AC * 21 TLE * 2 -- * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long N; cin>>N; string ans; unordered_set<long>S; auto f=[&](auto f, long long v)->void { if(v>N)return; if(v==N) { cout<<ans<<endl; exit(0); } if(S.count(v))return; S.insert(v); ans.push_back('A'); f(f,2*v+1); ans.pop_back(); ans.push_back('B'); f(f,3*v+1); ans.pop_back(); }; f(f,1); }