結果

問題 No.3460 Chocolate Divide Game
コンテスト
ユーザー shingo0909
提出日時 2026-02-28 14:42:06
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 595 ms / 2,000 ms
コード長 815 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,565 ms
コンパイル使用メモリ 339,496 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-02-28 14:42:15
合計ジャッジ時間 8,386 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    // int n = 1000;
    // vector<int> dp(n + 1, 0);
    // dp[1] = -1;
    // function<int(int)> dfs = [&](int i) {
    //     if (dp[i] != 0)
    //         return dp[i];
    //     rep(j, i) {
    //         if (j == 0)
    //             continue;
    //         if (dfs(max(i - j, j)) == -1)
    //             return dp[i] = 1;
    //     }
    //     return dp[i] = -1;
    // };
    // dfs(n);
    // rep(i, n) cout << i << " " << dp[i] << endl;

    set<ll> s;
    rep(i, 60) {
        s.insert((1LL << i) - 1);
    }
    int t;
    cin >> t;
    while (t--) {
        ll n;
        cin >> n;
        cout << (s.count(n) ? "Bob" : "Alice") << endl;
    }
    return 0;
}
0