AtCoder Regular Contest 148
翻译中…
Problem Statement
翻译中…
There are $2N$ integers $A_1, A_2, ..., A_{2N}$ written on a blackboard, and an integer $M$ at least $2$.
Alice and Bob will play a game. They will alternately perform the following operation, with Alice going first, until there is no number on the blackboard.
翻译中…
- Choose a number and delete it from the blackboard.
翻译中…
At the end of the game, if the sum of numbers deleted by Alice modulo $M$ equals the sum of numbers deleted by Bob modulo $M$, Bob wins; otherwise, Alice wins.
Which player will win if both plays optimally?
翻译中…
Constraints
翻译中…
$1 \leq N \leq 2 \times 10^5$$2 \leq M \leq 10^9$$0 \leq A_i \leq M - 1$- All values in the input are integers.
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N M
A_1 A_2 \dots A_{2N}
翻译中…
Output
翻译中…
If Alice wins, print Alice; if Bob wins, print Bob.
翻译中…
样例
Input #1
2 9
1 4 8 5
Output #1
Alice
The game may proceed as follows.
- Alice deletes $1$.
- Bob deletes $4$.
- Alice deletes $5$.
- Bob deletes $8$.
In this case, the sum of numbers deleted by Alice modulo $M$ is $(1 + 5) \bmod 9 = 6$, and the sum of numbers deleted by Bob modulo $M$ is $(4 + 8) \bmod 9 = 3$. Since $6 \neq 3$, Alice wins.
Input #2
3 998244353
1 2 3 1 2 3
Output #2
Bob
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。