結果

問題 No.2766 Delicious Multiply Spice
ユーザー matcharate12matcharate12
提出日時 2022-07-28 11:56:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 924 bytes
コンパイル時間 1,545 ms
コンパイル使用メモリ 169,464 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-31 20:50:13
合計ジャッジ時間 2,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 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 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 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,944 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 2 ms
6,944 KB
testcase_28 AC 2 ms
6,940 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 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,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