#C10393. Determine the Winner of the Taco Game
Determine the Winner of the Taco Game
Determine the Winner of the Taco Game
In the Taco Game, you are given a sequence of non-negative integers of length \(n\). The rules to determine the winner are as follows:
- If \(n = 1\), then Alice wins by default.
- If \(n > 1\) and every element in the sequence is zero, then Bob wins.
- Otherwise, Alice wins.
In mathematical terms, let \(a_1, a_2, \dots, a_n\) be the sequence. Then the outcome is: \[ \text{Winner} = \begin{cases} \text{Alice} & \text{if } n = 1 \text{ or } \exists i \text{ such that } a_i \neq 0, \\ \text{Bob} & \text{if } n > 1 \text{ and } a_i = 0 \; \forall i. \end{cases} \]
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains a single integer \(n\) \((1 \le n \le 10^5)\) representing the length of the sequence.
- The second line contains \(n\) space-separated non-negative integers.
outputFormat
Output via standard output (stdout) a single string: either Alice
or Bob
, indicating the winner of the game.
3
1 2 3
Alice