結果
| 問題 |
No.2766 Delicious Multiply Spice
|
| コンテスト | |
| ユーザー |
hatsuka_iwa
|
| 提出日時 | 2024-06-04 04:16:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 395 bytes |
| コンパイル時間 | 1,993 ms |
| コンパイル使用メモリ | 194,952 KB |
| 最終ジャッジ日時 | 2025-02-21 19:25:43 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N; cin >> N;
string Ans;
auto f = [&](auto f, long long X, string S) -> void {
if (X == 1) {
reverse(S.begin(), S.end());
Ans = S;
return;
}
if ((X - 1) % 2 == 0) f(f, (X - 1) / 2, S + 'A');
if ((X - 1) % 3 == 0) f(f, (X - 1) / 3, S + 'B');
};
f(f, N, "");
cout << Ans << endl;
}
hatsuka_iwa