結果

問題 No.2766 Delicious Multiply Spice
ユーザー matcharate12matcharate12
提出日時 2022-07-29 10:30:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 944 bytes
コンパイル時間 1,614 ms
コンパイル使用メモリ 168,176 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-31 20:50:54
合計ジャッジ時間 17,358 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 2 ms
6,948 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 3 ms
6,944 KB
testcase_20 AC 3 ms
6,940 KB
testcase_21 AC 133 ms
6,940 KB
testcase_22 AC 63 ms
6,940 KB
testcase_23 AC 52 ms
6,944 KB
testcase_24 AC 67 ms
6,944 KB
testcase_25 AC 447 ms
6,940 KB
testcase_26 AC 578 ms
6,944 KB
testcase_27 AC 569 ms
6,944 KB
testcase_28 AC 502 ms
6,944 KB
testcase_29 AC 628 ms
6,940 KB
testcase_30 AC 490 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

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;

void dfs(ll x,int n,string s){
	if(x >= n){
		if(x == n) ans = s;
		return;
	}
	if(x*2+1 <= n) dfs(x*2+1,n,s+'A');
	if(x*3+1 <= n) dfs(x*3+1,n,s+'B');
}

int main(void){
	int n; cin >> n;
	string s = "";
	dfs(1,n,s);
	cout << ans << endl;
}
0