問題一覧 > 通常問題

No.3258 Xor Division Game

レベル : / AI推定難易度 : 2300 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 22
作問者 : Iroha_3856 / テスター : lif4635 champignon tikuwa_
お気に入りにしたユーザー ProblemId : 11958 / 自分の提出
問題文最終更新日: 2025-09-05 21:17:25
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 481 菁々祭プログラミングコンテスト2025 (順位表) の他の問題:

Problem Statement

There is a multiset $S$ of integer sequences.

Initially, $S = \{(F_1, F_2, \ldots, F_N)\}$. Here, it is guaranteed that $F$ does not contain $0$.

For an integer sequence $A = (A_1, A_2, \ldots, A_K)$ with $A \in S$, splitting $A$ at position $i\ (1 \leq i \leq K)$ is defined as performing the following operations in order.

  • If $i \neq 1$, add $(A_1 \oplus A_i, A_2 \oplus A_i, \ldots, A_{i-1} \oplus A_i)$ to $S$.
  • If $i \neq K$, add $(A_{i+1} \oplus A_i, A_{i+2} \oplus A_i, \ldots, A_K \oplus A_i)$ to $S$.
  • Remove $1$ copy of $A$ from $S$.

Here, $\oplus$ denotes bitwise XOR.

Alice and Bob play the following game using $S$.

    Starting with Alice, the players alternately perform the following operation.
    • Choose any integer sequence $A$ with $A \in S$ and an $i$ such that $1 \leq i \leq |A|$, and split $A$ at position $i$.
    • However, an operation after which $S$ contains a sequence containing $0$ must not be performed.
The player who cannot perform an operation loses, and the other player wins.

Determine who wins when both players play optimally.

Input

$N$
$F_1\ F_2\ \ldots\ F_N$

All input satisfies the following constraints.

  • $1 \leq N \leq 2 \times 10^5$
  • $1 \leq F_i < 2^{30}$
  • All input values are integers.

Output

If Alice wins when both players play optimally, print Alice; if Bob wins, print Bob. Print a newline at the end.

Sample

Sample 1
Input
6
1 2 2 1 5 7
Output
Bob

For example, the game may proceed as follows:

Initially, $S = \{(1, 2, 2, 1, 5, 7)\}$.

Alice chooses the sequence $A = (1, 2, 2, 1, 5, 7) \in S$ and splits $A$ at position $5$.

After this, $S = \{(1 \oplus 5, 2 \oplus 5, 2 \oplus 5, 1 \oplus 5), (7 \oplus 5)\} = \{(4, 7, 7, 4), (2)\}$.

Bob chooses the sequence $A = (2) \in S$ and splits $A$ at position $1$.

After this, $S = \{(4, 7, 7, 4)\}$.

Since an operation that produces $0$ cannot be performed, Alice cannot perform any operation at this point, so Alice loses and Bob wins.

No matter how Alice plays, Bob wins by playing appropriately, so print Bob.

Sample 2
Input
1
1
Output
Alice

Initially, $S = \{(1)\}$.

Alice chooses the sequence $A = (1) \in S$ and splits $A$ at position $1$.

After this, $S = \{\}$.

Bob cannot perform any operation after this, so Bob loses and Alice wins.

Therefore, print Alice.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。