結果

問題 No.2766 Delicious Multiply Spice
ユーザー matcharate12
提出日時 2022-07-28 11:56:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 924 bytes
コンパイル時間 1,760 ms
コンパイル使用メモリ 167,368 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-20 22:04:15
合計ジャッジ時間 2,964 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 8
other AC * 23 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <chrono>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,a,b) for(int i = a; i < b; i++)
#define all(A) (A).begin(),(A).end()
#define MOD 1000000007
#define grt greater<int>()
#define mapf(M) for(auto& [k,v] : M)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using pq = priority_queue<ll,vector<ll>,greater<ll>>;
ll INF = 1LL<<60;
template <typename T>
bool chmax(T &a,T &b){ if(a < b){ a = b; return true; } return false; }
template <typename T>
bool chmin(T &a,T &b){ if(a > b){ a = b; return true; } return false; }
struct Edge { int to; int cost; int from; };
using Graph = vector<vector<Edge>>;
using vi = vector<int>;

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;
}

0