4583 G

时间限制1 S
内存限制128 MB
通过率23.6%(13 / 55)
题目描述

Alice and Bob are playing a game. Initially there are n positive numbers, the i-th number is ai . In one turn, Alice can choose an odd number and divide it into two positive numbers, or delete a number equals to 1. Bob can choose an even number and divide it into two positive numbers. Two players move in turns, and Alice move first. In one’s turn, if he or she can’t move, he or she lose the game. If two player move optimally, please find out who the winner is.

You need to answer T queries.

输入格式
First line contains one integer T (1 ≤ T ≤ 10e3 ). In each query: First line contains one integer n (1 ≤ n ≤ 10e5 ). Second line contains n integers, the i-th integer is ai (1 ≤ ai ≤ 10e9 ). The sum of n is less than 2 × 10e5.
输出格式
In each query, print Alice if Alice is the winner, print Bob otherwise
输入输出样例
输入复制
4
3
2 4 6
2
1 2
3
1 1 4
4
2 2 3 6
输出复制
Bob
Alice
Alice
Bob
数据范围与提示

In first query, there are no odd number, Alice can not make a move, so Bob wins.

In second query, Alice can delete 1, the list becomes [2]. Bob can divide 2 into 1, 1, the list becomes [1, 1]. Then, Alice can delete 1, the list becomes [1]. Now Bob can’t make a move, so Alice wins.

上传者
提交记录查看记录
题目类型传统
评测方式Special Judge
提交 / 通过55 / 13
相关讨论
暂无讨论