結果
| 問題 | No.2766 Delicious Multiply Spice |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:27:32 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 1,365 ms |
| コンパイル使用メモリ | 211,688 KB |
| 実行使用メモリ | 11,964 KB |
| 最終ジャッジ日時 | 2026-07-04 19:39:00 |
| 合計ジャッジ時間 | 2,353 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
long long N; cin >> N;
string answer = "";
bool ok = false;
auto f = [&](auto f,long long n) -> void {
if(n == 1){ok = true; return;}
n--;
if(n%2 == 0){
f(f,n/2);
if(ok){answer += 'A'; return;}
}
if(n%3 == 0){
f(f,n/3);
if(ok){answer += 'B'; return;}
}
};
f(f,N);
cout << answer << endl;
}