問題一覧 > 通常問題

No.3752 No Use Crying Over Suffixes

レベル : / AI推定難易度 : 1625 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 28
作問者 : marc2825 / テスター : siganai
お気に入りにしたユーザー ProblemId : 13473 / 自分の提出
問題文最終更新日: 2026-08-29 00:53:37
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 516 (順位表) の他の問題:

Problem Statement

There are $N$ piles, and pile $i$ contains $A_i$ stones.

$2$ players, Alice and Bob, play a game using these piles. Starting with Alice, they alternately perform the following operation.

The player whose turn it is chooses $1$ pile $i$ that has $1$ or more stones and removes $1$ stone from pile $i$.
If this operation causes pile $i$ to have $0$ stones, the numbers of stones in all piles after $i$, namely piles $i+1,i+2,\ldots,N$, also become $0$.

The players repeat this operation as long as there is a pile with $1$ or more stones. A player who cannot perform the operation on their turn loses.

You are given $T$ test cases. For each test case, determine which of Alice and Bob wins when both players play optimally.

Constraints

  • $1 \leq T \leq 10^5$
  • $1 \leq N$
  • $1 \leq A_i \leq 10^{9}$
  • The sum of $N$ over all test cases is at most $2 \times 10^5$
  • $T$, $N$, $A_i$ are integers

Input

The input is given from standard input in the following format. Here, the $t\ (1 \leq t \leq T)$-th test case is denoted by $\mathrm{case}_t$.

$T$
$\mathrm{case}_1$
$\mathrm{case}_2$
$\vdots$
$\mathrm{case}_T$

Each test case is given in the following format.

$N$
$A_1$ $A_2$ $\dots$ $A_N$

Here, $N$ is the number of piles, and $A_i$ is the number of stones in pile $i$.

Output

Print $T$ lines. For each test case, print Alice if Alice wins and Bob if Bob wins, on $1$ line.

Sample

Sample 1
Input
3
2
1 2
3
3 1 2
1
3
Output
Alice
Bob
Alice

In test case number $1$, Alice can remove $1$ stone from pile $1$. This causes pile $1$ to have $0$ stones, so the stones in pile $1$ and all piles after it, that is, pile $1$ and pile $2$, all become $0$. Therefore, Bob cannot perform the operation, and Alice wins.

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