結果
問題 |
No.2766 Delicious Multiply Spice
|
ユーザー |
|
提出日時 | 2024-05-15 17:09:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 318 bytes |
コンパイル時間 | 1,834 ms |
コンパイル使用メモリ | 168,856 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 22:05:36 |
合計ジャッジ時間 | 3,318 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 8 |
other | AC * 23 WA * 8 |
ソースコード
#include <bits/stdc++.h> #define all(A) (A).begin(),(A).end() using namespace std; string ans,s = ""; void dfs(string s,int i){ if(i == 1){ ans = s; return; } i--; if(i%2 == 0) dfs(s+'A',i/2); if(i%3 == 0) dfs(s+'B',i/3); } int main(void){ int n; cin >> n; dfs(s,n); reverse(all(ans)); cout << ans; }